-
Creator 版本:3.3.0
-
重现概率:必现
setAngularVelocity (v: number) {
this._body!.SetAngularVelocity(v);
}
getAngularVelocity () {
return toDegree(this._body!.GetAngularVelocity());
}
看代码,使用Box2D物理引擎,设置RigidBody2D的angularVelocity的时候用的是弧度制,获取的时候就变成角度制了?鉴于行为诡异且文档没有说明,我认为这是个bug。
例如,如果要让物体一秒旋转一圈,需要设置rb.angularVelocity = Math.PI * 2,然后console.log(rb.angularVelocity)得到的是360。