ソースを参照

Update babylon.abstractMesh.ts

Add a return to setPhysicsState in order to retrieve the physics body (and update its velocity or whatever we need).
Temechon 10 年 前
コミット
d292a1d42a
1 ファイル変更3 行追加3 行削除
  1. 3 3
      Babylon/Mesh/babylon.abstractMesh.ts

+ 3 - 3
Babylon/Mesh/babylon.abstractMesh.ts

@@ -518,7 +518,7 @@
         }
 
         // Physics
-        public setPhysicsState(impostor?: any, options?: PhysicsBodyCreationOptions): void {
+        public setPhysicsState(impostor?: any, options?: PhysicsBodyCreationOptions): any {
             var physicsEngine = this.getScene().getPhysicsEngine();
 
             if (!physicsEngine) {
@@ -548,7 +548,7 @@
             this._physicRestitution = options.restitution;
 
 
-            physicsEngine._registerMesh(this, impostor, options);
+            return physicsEngine._registerMesh(this, impostor, options);
         }
 
         public getPhysicsImpostor(): number {
@@ -870,4 +870,4 @@
             }
         }
     }
-}
+}