Explorar o código

Merge pull request #521 from Temechon/master

Oimo parameter updated.
Raanan Weber %!s(int64=10) %!d(string=hai) anos
pai
achega
37dc1a0f95
Modificáronse 1 ficheiros con 7 adicións e 5 borrados
  1. 7 5
      Babylon/Physics/Plugins/babylon.oimoJSPlugin.ts

+ 7 - 5
Babylon/Physics/Plugins/babylon.oimoJSPlugin.ts

@@ -231,8 +231,9 @@ module BABYLON {
                     mesh.computeWorldMatrix(true);
 
                     var center = mesh.getBoundingInfo().boundingBox.center;
-                    body.setPosition(center.x, center.y, center.z);
-                    body.setRotation(mesh.rotation.x, mesh.rotation.y, mesh.rotation.z);
+                    body.setPosition(new OIMO.Vec3(center.x, center.y, center.z));
+                    body.setRotation(new OIMO.Vec3(mesh.rotation.x, mesh.rotation.y, mesh.rotation.z));
+                    body.sleeping = false;
                     return;
                 }
                 // Case where the parent has been updated
@@ -244,8 +245,9 @@ module BABYLON {
                     var absoluteRotation = mesh.rotation;
 
                     body = registeredMesh.body.body;
-                    body.setPosition(absolutePosition.x, absolutePosition.y, absolutePosition.z);
-                    body.setRotation(absoluteRotation.x, absoluteRotation.y, absoluteRotation.z);
+                    body.setPosition(new OIMO.Vec3(absolutePosition.x, absolutePosition.y, absolutePosition.z));
+                    body.setRotation(new OIMO.Vec3(absoluteRotation.x, absoluteRotation.y, absoluteRotation.z));
+                    body.sleeping = false;
                     return;
                 }
             }
@@ -376,4 +378,4 @@ module BABYLON {
             }
         }
     }
-}
+}