소스 검색

Merge pull request #5758 from TrevorDev/ammoWakeupOnForce

ammojs wakeup on impulse/force
David Catuhe 6 년 전
부모
커밋
3b4b2c5b84
2개의 변경된 파일3개의 추가작업 그리고 1개의 파일을 삭제
  1. 1 1
      dist/preview release/what's new.md
  2. 2 0
      src/Physics/Plugins/ammoJSPlugin.ts

+ 1 - 1
dist/preview release/what's new.md

@@ -149,7 +149,7 @@
 - Fix more case sensitive paths ([mrdunk](https://github.com))
 - Attaching a BoundingBoxGizmo on a child should not remove its parent ([TrevorDev](https://github.com/TrevorDev)))
 - AmmoJS fix include issue caused after modules update and use world contact point to be consistent with oimo and cannon ([TrevorDev](https://github.com/TrevorDev)))
-- Oimo disable motor maxForce, cannonJS support no impostor, cannonJS cylinder axis ([TrevorDev](https://github.com/TrevorDev)))
+- Oimo disable motor maxForce, cannonJS support no impostor, cannonJS cylinder axis, ammoJS wake up impostor when apply force/impulse ([TrevorDev](https://github.com/TrevorDev)))
 - Utility layer should render on last active camera ([TrevorDev](https://github.com/TrevorDev))
 
 ### Core Engine

+ 2 - 0
src/Physics/Plugins/ammoJSPlugin.ts

@@ -208,6 +208,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
      * @param contactPoint the location to apply the impulse on the imposter
      */
     public applyImpulse(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3) {
+        impostor.physicsBody.activate();
         var worldPoint = this._tmpAmmoVectorA;
         var impulse = this._tmpAmmoVectorB;
 
@@ -231,6 +232,7 @@ export class AmmoJSPlugin implements IPhysicsEnginePlugin {
      * @param contactPoint the location to apply the force on the imposter
      */
     public applyForce(impostor: PhysicsImpostor, force: Vector3, contactPoint: Vector3) {
+        impostor.physicsBody.activate();
         var worldPoint = this._tmpAmmoVectorA;
         var impulse = this._tmpAmmoVectorB;