فهرست منبع

Merge pull request #231 from shannonmpoole/master

Impostor Constants Update
deltakosh 11 سال پیش
والد
کامیت
b8a13b81fe
3فایلهای تغییر یافته به همراه10 افزوده شده و 2 حذف شده
  1. 4 0
      Babylon/Physics/babylon.physicsEngine.js
  2. 5 1
      Babylon/Physics/babylon.physicsEngine.ts
  3. 1 1
      Exporters/Blender/io_export_babylon.py

+ 4 - 0
Babylon/Physics/babylon.physicsEngine.js

@@ -58,6 +58,10 @@
         PhysicsEngine.PlaneImpostor = 3;
         PhysicsEngine.CompoundImpostor = 4;
         PhysicsEngine.MeshImpostor = 4;
+        PhysicsEngine.CapsuleImpostor = 5;
+        PhysicsEngine.ConeImpostor = 6;
+        PhysicsEngine.CylinderImpostor = 7;
+        PhysicsEngine.ConvexHullImpostor = 8;
         PhysicsEngine.Epsilon = 0.001;
         return PhysicsEngine;
     })();

+ 5 - 1
Babylon/Physics/babylon.physicsEngine.ts

@@ -89,6 +89,10 @@
         public static PlaneImpostor = 3;
         public static CompoundImpostor = 4;
         public static MeshImpostor = 4;
+        public static CapsuleImpostor = 5;
+        public static ConeImpostor = 6;
+        public static CylinderImpostor = 7;
+        public static ConvexHullImpostor = 8;
         public static Epsilon = 0.001;
     }
-}
+}

+ 1 - 1
Exporters/Blender/io_export_babylon.py

@@ -644,7 +644,7 @@ class Export_babylon(bpy.types.Operator, ExportHelper):
 
         # Export Physics
         if object.rigid_body != None:
-            shape_items = {'BOX': 1, 'SPHERE': 2}
+            shape_items = { 'SPHERE': 1, 'BOX': 2, 'MESH': 4, 'CAPSULE': 5, 'CONE': 6, 'CYLINDER': 7, 'CONVEX_HULL': 8}
             shape_type = shape_items[object.rigid_body.collision_shape]
             Export_babylon.write_int(file_handler, "physicsImpostor", shape_type)
             mass = object.rigid_body.mass