diff options
author | Vincent <vinsteimes@gmail.com> | 2021-09-01 01:17:33 +0200 |
---|---|---|
committer | Vincent <vinsteimes@gmail.com> | 2021-09-09 16:40:16 +0200 |
commit | 70108fd8509a09230933872c3042a7c7ef2545b8 (patch) | |
tree | 7f495cbb6e81b923b148a15a0b8fbb7e9a18ede2 /modules/gridmap | |
parent | 3174e2782c5bf7c56dbb7318d69289220c4ad753 (diff) |
implement individual mesh transform for meshlibrary items
Diffstat (limited to 'modules/gridmap')
-rw-r--r-- | modules/gridmap/grid_map.cpp | 2 | ||||
-rw-r--r-- | modules/gridmap/grid_map_editor_plugin.cpp | 6 |
2 files changed, 7 insertions, 1 deletions
diff --git a/modules/gridmap/grid_map.cpp b/modules/gridmap/grid_map.cpp index 8e8b6f14ad..487e6deac0 100644 --- a/modules/gridmap/grid_map.cpp +++ b/modules/gridmap/grid_map.cpp @@ -475,7 +475,7 @@ bool GridMap::_octant_update(const OctantKey &p_key) { } Pair<Transform3D, IndexKey> p; - p.first = xform; + p.first = xform * mesh_library->get_item_mesh_transform(c.item); p.second = E->get(); multimesh_items[c.item].push_back(p); } diff --git a/modules/gridmap/grid_map_editor_plugin.cpp b/modules/gridmap/grid_map_editor_plugin.cpp index 2331a12d0f..c170bb107e 100644 --- a/modules/gridmap/grid_map_editor_plugin.cpp +++ b/modules/gridmap/grid_map_editor_plugin.cpp @@ -255,6 +255,12 @@ void GridMapEditor::_update_cursor_transform() { cursor_transform.basis *= node->get_cell_scale(); cursor_transform = node->get_global_transform() * cursor_transform; + if (selected_palette >= 0) { + if (node && !node->get_mesh_library().is_null()) { + cursor_transform *= node->get_mesh_library()->get_item_mesh_transform(selected_palette); + } + } + if (cursor_instance.is_valid()) { RenderingServer::get_singleton()->instance_set_transform(cursor_instance, cursor_transform); RenderingServer::get_singleton()->instance_set_visible(cursor_instance, cursor_visible); |