Browse Source

Merge pull request #245 from Jason0214/fix_concave_collision

Generate concave shapes has godot does
Lu Jiacheng 6 years ago
parent
commit
9c4d1874a3

+ 2 - 2
io_scene_godot/converters/physics.py

@@ -185,8 +185,8 @@ def generate_concave_shape(escn_file, export_settings, bl_object):
     if mesh is not None and mesh.polygons:
     if mesh is not None and mesh.polygons:
         vert_array = list()
         vert_array = list()
         for poly in mesh.polygons:
         for poly in mesh.polygons:
-            for vert_id in poly.vertices:
-                vert_array.append(list(mesh.vertices[vert_id].co))
+            for vert_id in reversed(poly.vertices):
+                vert_array.append(mesh.vertices[vert_id].co)
 
 
         col_shape = InternalResource("ConcavePolygonShape", mesh.name)
         col_shape = InternalResource("ConcavePolygonShape", mesh.name)
         col_shape['data'] = Array("PoolVector3Array(", values=vert_array)
         col_shape['data'] = Array("PoolVector3Array(", values=vert_array)

File diff suppressed because it is too large
+ 0 - 0
tests/reference_exports/mesh/physics.escn


Some files were not shown because too many files changed in this diff