From 37da8155a4500a9386027b4d791a86186bc7ab4a Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sun, 27 Aug 2017 16:00:59 -0300 Subject: -Largely rewrote gridmap to simplify it -Got editor working again -Added a current-floor marker on selection --- editor/plugins/cube_grid_theme_editor_plugin.cpp | 21 ++++++++------------- 1 file changed, 8 insertions(+), 13 deletions(-) (limited to 'editor/plugins') 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 p_library, p_library->set_item_mesh(id, mesh); - Ref collision; + Vector collisions; for (int j = 0; j < mi->get_child_count(); j++) { @@ -119,24 +119,19 @@ void MeshLibraryEditor::_import_scene(Node *p_scene, Ref 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 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 navmesh; for (int j = 0; j < mi->get_child_count(); j++) { Node *child2 = mi->get_child(j); -- cgit v1.2.3