Don't try to merge unused bone AABBs in the rendering server

This commit is contained in:
Aaron Franke 2022-08-14 21:14:34 -05:00
parent 5a8d786ef9
commit e0d80b37e9
No known key found for this signature in database
GPG key ID: 40A1750B977E56BF
2 changed files with 8 additions and 2 deletions

View file

@ -255,8 +255,11 @@ 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];
if (!bone.has_no_volume()) {
mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
}
}
mesh->aabb.merge_with(p_surface.aabb);
}

View file

@ -416,8 +416,11 @@ 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];
if (!bone.has_no_volume()) {
mesh->bone_aabbs.write[i].merge_with(p_surface.bone_aabbs[i]);
}
}
mesh->aabb.merge_with(p_surface.aabb);
}