diff options
Diffstat (limited to 'modules/raycast')
-rw-r--r-- | modules/raycast/lightmap_raycaster.cpp | 8 | ||||
-rw-r--r-- | modules/raycast/raycast_occlusion_cull.cpp | 6 | ||||
-rw-r--r-- | modules/raycast/static_raycaster.cpp | 8 |
3 files changed, 11 insertions, 11 deletions
diff --git a/modules/raycast/lightmap_raycaster.cpp b/modules/raycast/lightmap_raycaster.cpp index 7e7c3f9067..fc9ac416b7 100644 --- a/modules/raycast/lightmap_raycaster.cpp +++ b/modules/raycast/lightmap_raycaster.cpp @@ -153,16 +153,16 @@ void LightmapRaycasterEmbree::commit() { } void LightmapRaycasterEmbree::set_mesh_filter(const RBSet<int> &p_mesh_ids) { - for (RBSet<int>::Element *E = p_mesh_ids.front(); E; E = E->next()) { - rtcDisableGeometry(rtcGetGeometry(embree_scene, E->get())); + for (const int &E : p_mesh_ids) { + rtcDisableGeometry(rtcGetGeometry(embree_scene, E)); } rtcCommitScene(embree_scene); filter_meshes = p_mesh_ids; } void LightmapRaycasterEmbree::clear_mesh_filter() { - for (RBSet<int>::Element *E = filter_meshes.front(); E; E = E->next()) { - rtcEnableGeometry(rtcGetGeometry(embree_scene, E->get())); + for (const int &E : filter_meshes) { + rtcEnableGeometry(rtcGetGeometry(embree_scene, E)); } rtcCommitScene(embree_scene); filter_meshes.clear(); diff --git a/modules/raycast/raycast_occlusion_cull.cpp b/modules/raycast/raycast_occlusion_cull.cpp index c165354c7b..89e75f774e 100644 --- a/modules/raycast/raycast_occlusion_cull.cpp +++ b/modules/raycast/raycast_occlusion_cull.cpp @@ -223,9 +223,9 @@ void RaycastOcclusionCull::occluder_set_mesh(RID p_occluder, const PackedVector3 occluder->vertices = p_vertices; occluder->indices = p_indices; - for (RBSet<InstanceID>::Element *E = occluder->users.front(); E; E = E->next()) { - RID scenario_rid = E->get().scenario; - RID instance_rid = E->get().instance; + for (const InstanceID &E : occluder->users) { + RID scenario_rid = E.scenario; + RID instance_rid = E.instance; ERR_CONTINUE(!scenarios.has(scenario_rid)); Scenario &scenario = scenarios[scenario_rid]; ERR_CONTINUE(!scenario.instances.has(instance_rid)); diff --git a/modules/raycast/static_raycaster.cpp b/modules/raycast/static_raycaster.cpp index f2e944a82d..5d2dedf1a4 100644 --- a/modules/raycast/static_raycaster.cpp +++ b/modules/raycast/static_raycaster.cpp @@ -95,16 +95,16 @@ void StaticRaycasterEmbree::commit() { } void StaticRaycasterEmbree::set_mesh_filter(const RBSet<int> &p_mesh_ids) { - for (RBSet<int>::Element *E = p_mesh_ids.front(); E; E = E->next()) { - rtcDisableGeometry(rtcGetGeometry(embree_scene, E->get())); + for (const int &E : p_mesh_ids) { + rtcDisableGeometry(rtcGetGeometry(embree_scene, E)); } rtcCommitScene(embree_scene); filter_meshes = p_mesh_ids; } void StaticRaycasterEmbree::clear_mesh_filter() { - for (RBSet<int>::Element *E = filter_meshes.front(); E; E = E->next()) { - rtcEnableGeometry(rtcGetGeometry(embree_scene, E->get())); + for (const int &E : filter_meshes) { + rtcEnableGeometry(rtcGetGeometry(embree_scene, E)); } rtcCommitScene(embree_scene); filter_meshes.clear(); |