Ver código fonte

Merge pull request #952 from RaananW/physics-body-transformation

Small physics update
Raanan Weber 9 anos atrás
pai
commit
b4dc8a5b8d

+ 4 - 0
src/Mesh/babylon.abstractMesh.js

@@ -684,6 +684,10 @@ var BABYLON;
             this.getScene().getPhysicsEngine()._createLink(this, otherMesh, pivot1, pivot2, options);
         };
         AbstractMesh.prototype.updatePhysicsBodyPosition = function () {
+            BABYLON.Tools.Warn("updatePhysicsBodyPosition() is deprecated, please use updatePhysicsBody()");
+            this.updatePhysicsBody();
+        };
+        AbstractMesh.prototype.updatePhysicsBody = function () {
             if (!this._physicImpostor) {
                 return;
             }

+ 5 - 0
src/Mesh/babylon.abstractMesh.ts

@@ -795,6 +795,11 @@
         }
 
         public updatePhysicsBodyPosition(): void {
+            Tools.Warn("updatePhysicsBodyPosition() is deprecated, please use updatePhysicsBody()")
+            this.updatePhysicsBody();
+        }
+        
+        public updatePhysicsBody(): void {
             if (!this._physicImpostor) {
                 return;
             }

+ 3 - 0
src/Physics/babylon.physicsEngine.js

@@ -54,6 +54,9 @@ var BABYLON;
         PhysicsEngine.prototype.getPhysicsPluginName = function () {
             return this._currentPlugin.name;
         };
+        PhysicsEngine.prototype.getWorldObject = function () {
+            return this._currentPlugin.getWorldObject();
+        };
         // Statics
         PhysicsEngine.NoImpostor = 0;
         PhysicsEngine.SphereImpostor = 1;

+ 4 - 0
src/Physics/babylon.physicsEngine.ts

@@ -100,6 +100,10 @@
         public getPhysicsPluginName(): string {
             return this._currentPlugin.name;
         }
+        
+        public getWorldObject() : any {
+            return this._currentPlugin.getWorldObject();
+        }
 
         // Statics
         public static NoImpostor = 0;