Jelajahi Sumber

Physics parsing

Thou deprecated, this should still be included in the mesh's Parse
method.
Raanan Weber 9 tahun lalu
induk
melakukan
460c21cc3a
1 mengubah file dengan 10 tambahan dan 0 penghapusan
  1. 10 0
      src/Mesh/babylon.mesh.ts

+ 10 - 0
src/Mesh/babylon.mesh.ts

@@ -1765,6 +1765,16 @@
             } else {
                 mesh.layerMask = 0x0FFFFFFF;
             }
+            
+             
+            //(Deprecated) physics
+            if(parsedMesh.physicsImpostor) {
+                mesh.physicsImpostor = new BABYLON.PhysicsImpostor(mesh, parsedMesh.physicsImpostor, {
+                    mass: parsedMesh.physicsMass,
+                    friction: parsedMesh.physicsFriction,
+                    restitution: parsedMesh.physicsRestitution
+                }, scene);
+            }
 
             // Instances
             if (parsedMesh.instances) {