浏览代码

Update io_export_babylon.py

This is PR one in a series for creating an ammojs plugin.

The box and sphere constants were backwards from what I found in the engine so I swapped them here.

I also want to eventually read from the BGE values as well but that looks fairly involved so I will save that for some other time.

More to come as soon as I can find the time to do a bit more testing.
Shannon Poole 11 年之前
父节点
当前提交
5d1626ac92
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Exporters/Blender/io_export_babylon.py

+ 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