用户:
YDS尹子查看:21 回复:31 评论:21 创建时间:2021-05-02T07:42:14
这个可以应用到很多地方,比如说,打✈:


这是示例,意思是给所有有plane标签的模型加上这个特效。
如果发现旋转有问题,请调整Quat里面的数值
const Quat = new Box3Quaternion(0,0,0,1)// box引擎默认的旋转朝向
setInterval(()=>{
world.querySelectorAll(".plane").forEach((e)=>{
e.meshOrientation=Quat.rotateX(Math.atan2(e.velocity.y,e.velocity.x)).add(Quat.rotateY(e.velocity.z,e.velocity.x))
})
},100)