cannon物理clone BUg
sheenli opened this issue · comments
表现
clone后的物理出现乱飞
原因
set angularVelocity(value: Vector3) { this._angularVelocity = value; if (this._btColliderObject) { var btValue: CANNON.Vec3= this.btColliderObject.angularVelocity; (this.isSleeping)&&(this.wakeUp()); btValue.set(value.x,value.y,value.z); this.btColliderObject.velocity = btValue; } }
解决办法
set angularVelocity(value: Vector3) { this._angularVelocity = value; if (this._btColliderObject) { var btValue: CANNON.Vec3= this.btColliderObject.angularVelocity; (this.isSleeping)&&(this.wakeUp()); btValue.set(value.x,value.y,value.z); this.btColliderObject.angularVelocity = btValue; } }