summaryrefslogtreecommitdiff
path: root/scene/3d
diff options
context:
space:
mode:
authorRĂ©mi Verschelde <remi@verschelde.fr>2021-07-25 12:52:58 +0200
committerGitHub <noreply@github.com>2021-07-25 12:52:58 +0200
commitff0b5f8fa1be4ccd5b8de1d9d49f8a4b71439f63 (patch)
tree42543cc85d27d2c8692a2ced4bac5c537e402004 /scene/3d
parent2f221e5fd507b176590bda52d08e499629ce7761 (diff)
parentac3322b0af8f23e8e2dac8111200bc69b5604c9f (diff)
Merge pull request #50809 from akien-mga/iterators-const-references
Diffstat (limited to 'scene/3d')
-rw-r--r--scene/3d/gpu_particles_collision_3d.cpp2
-rw-r--r--scene/3d/mesh_instance_3d.cpp2
-rw-r--r--scene/3d/physics_body_3d.cpp2
-rw-r--r--scene/3d/skeleton_3d.cpp2
-rw-r--r--scene/3d/soft_body_3d.cpp2
5 files changed, 5 insertions, 5 deletions
diff --git a/scene/3d/gpu_particles_collision_3d.cpp b/scene/3d/gpu_particles_collision_3d.cpp
index 97b562837a..cc1b620025 100644
--- a/scene/3d/gpu_particles_collision_3d.cpp
+++ b/scene/3d/gpu_particles_collision_3d.cpp
@@ -397,7 +397,7 @@ Ref<Image> GPUParticlesCollisionSDF::bake() {
bake_step_function(0, "Finding Meshes");
}
- for (PlotMesh &pm : plot_meshes) {
+ for (const PlotMesh &pm : plot_meshes) {
for (int i = 0; i < pm.mesh->get_surface_count(); i++) {
if (pm.mesh->surface_get_primitive_type(i) != Mesh::PRIMITIVE_TRIANGLES) {
continue; //only triangles
diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp
index 93cd088418..9ca1d55d0b 100644
--- a/scene/3d/mesh_instance_3d.cpp
+++ b/scene/3d/mesh_instance_3d.cpp
@@ -94,7 +94,7 @@ void MeshInstance3D::_get_property_list(List<PropertyInfo> *p_list) const {
ls.sort();
- for (String &E : ls) {
+ for (const String &E : ls) {
p_list->push_back(PropertyInfo(Variant::FLOAT, E, PROPERTY_HINT_RANGE, "-1,1,0.00001"));
}
diff --git a/scene/3d/physics_body_3d.cpp b/scene/3d/physics_body_3d.cpp
index 6736a4ec40..93ecb2cd3a 100644
--- a/scene/3d/physics_body_3d.cpp
+++ b/scene/3d/physics_body_3d.cpp
@@ -78,7 +78,7 @@ TypedArray<PhysicsBody3D> PhysicsBody3D::get_collision_exceptions() {
List<RID> exceptions;
PhysicsServer3D::get_singleton()->body_get_collision_exceptions(get_rid(), &exceptions);
Array ret;
- for (RID body : exceptions) {
+ for (const RID &body : exceptions) {
ObjectID instance_id = PhysicsServer3D::get_singleton()->body_get_object_instance_id(body);
Object *obj = ObjectDB::get_instance(instance_id);
PhysicsBody3D *physics_body = Object::cast_to<PhysicsBody3D>(obj);
diff --git a/scene/3d/skeleton_3d.cpp b/scene/3d/skeleton_3d.cpp
index fb5e9639c7..9ce4c37457 100644
--- a/scene/3d/skeleton_3d.cpp
+++ b/scene/3d/skeleton_3d.cpp
@@ -264,7 +264,7 @@ void Skeleton3D::_notification(int p_what) {
b.global_pose_override_amount = 0.0;
}
- for (ObjectID &E : b.nodes_bound) {
+ for (const ObjectID &E : b.nodes_bound) {
Object *obj = ObjectDB::get_instance(E);
ERR_CONTINUE(!obj);
Node3D *node_3d = Object::cast_to<Node3D>(obj);
diff --git a/scene/3d/soft_body_3d.cpp b/scene/3d/soft_body_3d.cpp
index 0d00d10d32..a7ff0842d2 100644
--- a/scene/3d/soft_body_3d.cpp
+++ b/scene/3d/soft_body_3d.cpp
@@ -592,7 +592,7 @@ Array SoftBody3D::get_collision_exceptions() {
List<RID> exceptions;
PhysicsServer3D::get_singleton()->soft_body_get_collision_exceptions(physics_rid, &exceptions);
Array ret;
- for (RID body : exceptions) {
+ for (const RID &body : exceptions) {
ObjectID instance_id = PhysicsServer3D::get_singleton()->body_get_object_instance_id(body);
Object *obj = ObjectDB::get_instance(instance_id);
PhysicsBody3D *physics_body = Object::cast_to<PhysicsBody3D>(obj);