소스 검색

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