diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2022-01-19 13:59:41 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-19 13:59:41 +0100 |
commit | 26c42331bcb63380a4235f9d32694b53518e4280 (patch) | |
tree | 9a6070d27b659b532d575474d041cd29d67876c5 /editor | |
parent | 6ab5d9d0082f48a3a7b2e9cc8f5c8d0c2fe16d1e (diff) | |
parent | 025d7b933266901f49c05922e85b70dd9b3b8b19 (diff) |
Merge pull request #56907 from rburing/convert_to_meshlibrary_apply_transforms
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/mesh_library_editor_plugin.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/editor/plugins/mesh_library_editor_plugin.cpp b/editor/plugins/mesh_library_editor_plugin.cpp index d82d0c6ffc..95786176ee 100644 --- a/editor/plugins/mesh_library_editor_plugin.cpp +++ b/editor/plugins/mesh_library_editor_plugin.cpp @@ -136,9 +136,11 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, continue; } - //Transform3D shape_transform = sb->shape_owner_get_transform(E); - - //shape_transform.set_origin(shape_transform.get_origin() - phys_offset); + Transform3D shape_transform; + if (p_apply_xforms) { + shape_transform = mi->get_transform(); + } + shape_transform *= sb->get_transform() * sb->shape_owner_get_transform(E); for (int k = 0; k < sb->shape_owner_get_shape_count(E); k++) { Ref<Shape3D> collision = sb->shape_owner_get_shape(E, k); @@ -147,7 +149,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, } MeshLibrary::ShapeData shape_data; shape_data.shape = collision; - shape_data.local_transform = sb->get_transform() * sb->shape_owner_get_transform(E); + shape_data.local_transform = shape_transform; collisions.push_back(shape_data); } } |