diff options
author | Juan Linietsky <reduzio@gmail.com> | 2017-08-27 16:00:59 -0300 |
---|---|---|
committer | Juan Linietsky <reduzio@gmail.com> | 2017-08-27 16:02:00 -0300 |
commit | 37da8155a4500a9386027b4d791a86186bc7ab4a (patch) | |
tree | 685c9f1f1ef8c2bd2c3b02e55266895c61bd9128 /editor | |
parent | bd282ff43f23fe845f29a3e25c8efc01bd65ffb0 (diff) |
-Largely rewrote gridmap to simplify it
-Got editor working again
-Added a current-floor marker on selection
Diffstat (limited to 'editor')
-rw-r--r-- | editor/plugins/cube_grid_theme_editor_plugin.cpp | 21 |
1 files changed, 8 insertions, 13 deletions
diff --git a/editor/plugins/cube_grid_theme_editor_plugin.cpp b/editor/plugins/cube_grid_theme_editor_plugin.cpp index 237099abe7..36c0b44e38 100644 --- a/editor/plugins/cube_grid_theme_editor_plugin.cpp +++ b/editor/plugins/cube_grid_theme_editor_plugin.cpp @@ -98,7 +98,7 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, p_library->set_item_mesh(id, mesh); - Ref<Shape> collision; + Vector<MeshLibrary::ShapeData> collisions; for (int j = 0; j < mi->get_child_count(); j++) { @@ -119,24 +119,19 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref<MeshLibrary> p_library, for (int k = 0; k < sb->shape_owner_get_shape_count(E->get()); k++) { - collision = sb->shape_owner_get_shape(E->get(), k); + Ref<Shape> collision = sb->shape_owner_get_shape(E->get(), k); if (collision.is_valid()) - break; - /* TileSet::ShapeData shape_data; - shape_data.shape = shape; - shape_data.shape_transform = shape_transform; - shape_data.one_way_collision = one_way; - collisions.push_back(shape_data);*/ + continue; + MeshLibrary::ShapeData shape_data; + shape_data.shape = collision; + shape_data.local_transform = sb->shape_owner_get_transform(E->get()); + collisions.push_back(shape_data); } - if (collision.is_valid()) - break; } } - if (!collision.is_null()) { + p_library->set_item_shapes(id, collisions); - p_library->set_item_shape(id, collision); - } Ref<NavigationMesh> navmesh; for (int j = 0; j < mi->get_child_count(); j++) { Node *child2 = mi->get_child(j); |