用户:
小鱼队长查看:4 回复:6 评论:4 创建时间:2022-02-15T08:43:15
今天我教大家如何买冰墩墩
az说错了
今天我来教大家如何变成冰墩墩
搜索冰墩墩
找到:
冰墩墩身体&头
冰墩墩 手
冰墩墩 腿 左/右
然后在代码区输入代码:
const bodyData = [
{ bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/冰墩墩身体&头副本.vb', offset: [0, 0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_UPPER_ARM, name: '左上臂', mesh: 'mesh/冰墩墩 手 .vb', offset: [0.1, 0.07,-0.02], rotate: [-128, 120, -85], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_UPPER_ARM, name: '右上臂', mesh: 'mesh/冰墩墩 手 .vb', offset: [-0.1, 0.07,-0.02], rotate: [-45, -120, -85], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_UPPER_LEG, name: '左上腿', mesh: 'mesh/冰墩墩 腿 左.vb', offset: [0, -0.05, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_UPPER_LEG, name: '右上腿', mesh: 'mesh/冰墩墩 腿 右.vb', offset: [0, -0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
]
world.onPlayerJoin(({ entity }) => {
// 隐藏所有身体部件!
for (const bodyPart in entity.player.skinInvisible) {
entity.player.skinInvisible[bodyPart] = true;
}
// 根据配置穿戴身体各个部件
for (const data of bodyData) {
addWearable(entity, data)
}
});
// 添加部件
function addWearable(entity, data) {
// 这一步是把角度转成弧度
const orientation = new Box3Quaternion(0, 0, 0, 1)
.rotateZ(data.rotate[2] * Math.PI / 180)
.rotateX(data.rotate[0] * Math.PI / 180)
.rotateY(data.rotate[1] * Math.PI / 180)
// 将上面声明的配置一一对应地传递给传递API
entity.player.addWearable({
bodyPart: data.bodyPart,
mesh: data.mesh,
orientation: orientation,
scale: data.scale,
offset: data.offset,
})
}
就能变成冰墩墩啦!
有没有人想变成雪容容?
我肯定有办法
搜索雪容容
找到:
雪容容 手
雪容容 腿
雪容容(头)
输入代码:
const bodyData = [
{ bodyPart: Box3BodyPart.HEAD, name: '头', mesh: 'mesh/雪容容(头).vb', offset: [0, 0.4, -0.1], rotate: [0, 450, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/雪容容身体.vb', offset: [0, 0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_UPPER_ARM, name: '左上臂', mesh: 'mesh/雪容容 手 .vb', offset: [0.1, 0.07,-0.02], rotate: [-128, 120, -85], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_UPPER_ARM, name: '右上臂', mesh: 'mesh/雪容容 手 .vb', offset: [-0.1, 0.07,-0.02], rotate: [-45, -120, -85], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.LEFT_UPPER_LEG, name: '左上腿', mesh: 'mesh/雪容容 腿.vb', offset: [0, -0.05, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
{ bodyPart: Box3BodyPart.RIGHT_UPPER_LEG, name: '右上腿', mesh: 'mesh/雪容容 腿.vb', offset: [0, -0.1, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
]
world.onPlayerJoin(({ entity }) => {
// 隐藏所有身体部件!
for (const bodyPart in entity.player.skinInvisible) {
entity.player.skinInvisible[bodyPart] = true;
}
// 根据配置穿戴身体各个部件
for (const data of bodyData) {
addWearable(entity, data)
}
});
// 添加部件
function addWearable(entity, data) {
// 这一步是把角度转成弧度
const orientation = new Box3Quaternion(0, 0, 0, 1)
.rotateZ(data.rotate[2] * Math.PI / 180)
.rotateX(data.rotate[0] * Math.PI / 180)
.rotateY(data.rotate[1] * Math.PI / 180)
// 将上面声明的配置一一对应地传递给传递API
entity.player.addWearable({
bodyPart: data.bodyPart,
mesh: data.mesh,
orientation: orientation,
scale: data.scale,
offset: data.offset,
})
}
就变成雪容容啦!