用户:
精神I病院广东省分院院长查看:3 回复:5 评论:3 创建时间:2022-12-31T16:37:00
又来问问题了
e.car.meshOrientation.copy(e.meshOrientation)
为啥这串代码没用 视角还是无法和玩家实时同步qwq
(加了onTick e.car模型也创建了)
精神I病院广东省分院院长亦或说这样写
e.car.meshOrientation=Quat.rotateX(e.rotateX).rotateY(e.rotateY).rotateZ(e.rotateZ)
为啥运行没报错 但也没效果
点赞0
评论
伴雪纷飞e.car.meshOrientation = Quat.rotateY(Math.atan2(e.player.facingDirection.z, e.player.facingDirection.x))
平面旋转
e.car.meshOrientation = Quat.rotateY(Math.atan2(e.player.facingDirection.z, e.player.facingDirection.x)).rotateZ(Math.atan2(e.player.facingDirection.y,Math.sqrt(e.player.facingDirection.x**2+e.player.facingDirection.z**2)))
三维旋转
e就是玩家实体
e.car就是旋转的对象(接着上面的代码写的)
点赞1
评论