Browse Source

Merge pull request #4451 from RaananW/oimo-velocities

Fixing oimo velocity functions
David Catuhe 7 years ago
parent
commit
b9eaf92fb0
2 changed files with 3 additions and 2 deletions
  1. 1 0
      dist/preview release/what's new.md
  2. 2 2
      src/Physics/Plugins/babylon.oimoJSPlugin.ts

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

@@ -69,6 +69,7 @@
 - Fixed `HighlightLayer` support on browsers not supporting HalfFloat ([sebavan](http://www.github.com/sebavan))
 - Fixed support for R and RG texture formats ([sebavan](http://www.github.com/sebavan))
 - Fixed `updatable` parameter setting in the SPS ([jerome](https://github.com/jbousquie))
+- Angular and linear velocity were using the wrong method to copy values to the physics engine ([RaananW](https://github.com/RaananW))
 
 ### Viewer
 

+ 2 - 2
src/Physics/Plugins/babylon.oimoJSPlugin.ts

@@ -351,11 +351,11 @@ module BABYLON {
         }*/
 
         public setLinearVelocity(impostor: PhysicsImpostor, velocity: Vector3) {
-            impostor.physicsBody.linearVelocity.init(velocity.x, velocity.y, velocity.z);
+            impostor.physicsBody.linearVelocity.copy(velocity);
         }
 
         public setAngularVelocity(impostor: PhysicsImpostor, velocity: Vector3) {
-            impostor.physicsBody.angularVelocity.init(velocity.x, velocity.y, velocity.z);
+            impostor.physicsBody.angularVelocity.copy(velocity);
         }
 
         public getLinearVelocity(impostor: PhysicsImpostor): Nullable<Vector3> {