Pārlūkot izejas kodu

ammojs wakeup on impulse/force

Trevor Baron 6 gadi atpakaļ
vecāks
revīzija
277e7d6ca7

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