Merge pull request #64581 from aaronfranke/aabb

Use a const ref for the bone AABB in rendering code
This commit is contained in:
Clay John 2022-08-18 14:04:46 -06:00 committed by GitHub
commit 54eaf662b4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 4 deletions

View file

@ -255,9 +255,9 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
mesh->bone_aabbs.resize(p_surface.bone_aabbs.size());
}
for (int i = 0; i < p_surface.bone_aabbs.size(); i++) {
AABB bone = p_surface.bone_aabbs[i];
const AABB &bone = p_surface.bone_aabbs[i];
if (!bone.has_no_volume()) {
mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
mesh->bone_aabbs.write[i].merge_with(bone);
}
}
mesh->aabb.merge_with(p_surface.aabb);

View file

@ -416,9 +416,9 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
mesh->bone_aabbs.resize(p_surface.bone_aabbs.size());
}
for (int i = 0; i < p_surface.bone_aabbs.size(); i++) {
AABB bone = p_surface.bone_aabbs[i];
const AABB &bone = p_surface.bone_aabbs[i];
if (!bone.has_no_volume()) {
mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
mesh->bone_aabbs.write[i].merge_with(bone);
}
}
mesh->aabb.merge_with(p_surface.aabb);