فهرست منبع

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 @@
             }
         }
     }
-}
+}