Forráskód Böngészése

Merge pull request #4451 from RaananW/oimo-velocities

Fixing oimo velocity functions
David Catuhe 7 éve
szülő
commit
b9eaf92fb0

+ 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 `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 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))
 - 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
 ### Viewer
 
 

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

@@ -351,11 +351,11 @@ module BABYLON {
         }*/
         }*/
 
 
         public setLinearVelocity(impostor: PhysicsImpostor, velocity: Vector3) {
         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) {
         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> {
         public getLinearVelocity(impostor: PhysicsImpostor): Nullable<Vector3> {