用户:
徐子妍的哥哥查看:1 回复:4 评论:1 创建时间:2023-02-01T11:08:23
fconst Quat = new Box3Quaternion(0, 0, 0, 1) for (const e of world.querySelectorAll('*')) { e.collides = true e.fixed = true e.onEntityContact(({ other }) => { if(other.isPlayer){// 如果跟当前实体碰撞的是玩家实体 other.player.invisible = true // 玩家皮肤隐藏 other.mesh = e.mesh // 玩家的外形换成当前实体的外形 other.meshScale.copy(e.meshScale) // 玩家外形的缩放比例设成跟当前实体一样
//如果模型方向不正确, 则建议在模型编辑器里把模型转向修正
//other.meshOrientation = Quat.rotateY(Math.PI) // 如果模型方向不对, 尝试旋转180度来修正, Math.PI是 180度的弧度值 //other.meshOrientation = Quat.rotateY(Math.PI/2) // 如果模型方向不对, 尝试旋转90度来修正 // other.meshOrientation = Quat.rotateY(-Math.PI/2) // 如果模型方向不对, 尝试旋转-90度来修正
other.player.scale = e.meshScale.scale(e.bounds.y / other.bounds.y) //喵家的隐形碰撞盒缩放到模型刚好 贴地 } }) } 这个Quat 报错了?