猫史档案馆


【代码】和平队长皮肤代码

用户:打酱油的企鹅呀打酱油的企鹅呀查看:2 回复:2 评论:2 创建时间:2021-12-25T14:23:28


如下:

const bodyData = [
 { bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/和平队长身体部件.vb', offset: [0, 0.5, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_LOWER_ARM, name: '左下臂', mesh: 'mesh/和平队长手部件.vb', offset: [-0.15, 0.25, -0.3], rotate: [50, 50, -50], scale: [0.6, 0.6, 0.6] },
 { bodyPart: Box3BodyPart.RIGHT_LOWER_ARM, name: '右下臂', mesh: 'mesh/和平队长手部件.vb', offset: [0.15, 0.25, -0.3], rotate: [-50, -50, -50], scale: [0.6, 0.6, 0.6] },
    ]
    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,
        })
    }


回复

上一页1 页 / 共 1下一页
你好2050_反防沉迷_反岛三出图形化你好2050_反防沉迷_反岛三出图形化

模型分别是哪些(把模型链接附上)

点赞0


评论


eujioeujio

const bodyData = [
 { bodyPart: Box3BodyPart.TORSO, name: '躯干', mesh: 'mesh/和平队长身体部件.vb', offset: [0, 0.5, 0], rotate: [0, 90, 0], scale: [0.5, 0.5, 0.5] },
 { bodyPart: Box3BodyPart.LEFT_LOWER_ARM, name: '左下臂', mesh: 'mesh/和平队长手部件.vb', offset: [-0.15, 0.25, -0.3], rotate: [50, 50, -50], scale: [0.6, 0.6, 0.6] },
 { bodyPart: Box3BodyPart.RIGHT_LOWER_ARM, name: '右下臂', mesh: 'mesh/和平队长手部件.vb', offset: [0.15, 0.25, -0.3], rotate: [-50, -50, -50], scale: [0.6, 0.6, 0.6] },
    ]
    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,
        })
    }

点赞0


评论