Browse Source

Generate concave shapes has godot does

Generate concave shapes with inverted faces as Godot does
Andrea Catania 7 years ago
parent
commit
89f07c64ab

+ 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