layabox / LayaAir

LayaAir is a fully platform rendering engine with rich 2D/3D rendering capabilities and a mature integrated development platform

Home Page:https://www.layaair.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cannon物理clone BUg

sheenli opened this issue · comments

commented

表现

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; } }