1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-21 14:57:09 +00:00

Add ShadowCastingSetting to MeshLibrary / GridMap items

Adds ShadowCastingSetting to MeshLibrary / GridMap items.
This commit is contained in:
smix8
2023-11-27 19:37:52 +01:00
parent bbc54692c0
commit 612981c1ea
6 changed files with 77 additions and 0 deletions

View File

@@ -1233,6 +1233,8 @@ void GridMapEditor::_update_cursor_instance() {
Ref<Mesh> mesh = node->get_mesh_library()->get_item_mesh(selected_palette);
if (!mesh.is_null() && mesh->get_rid().is_valid()) {
cursor_instance = RenderingServer::get_singleton()->instance_create2(mesh->get_rid(), get_tree()->get_root()->get_world_3d()->get_scenario());
RS::ShadowCastingSetting cast_shadows = (RS::ShadowCastingSetting)node->get_mesh_library()->get_item_mesh_cast_shadow(selected_palette);
RS::get_singleton()->instance_geometry_set_cast_shadows_setting(cursor_instance, cast_shadows);
}
}
} else if (mode_buttons_group->get_pressed_button() == select_mode_button) {