summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:32:32 +0100
committerRémi Verschelde <rverschelde@gmail.com>2022-12-17 12:32:32 +0100
commit2b056115ef6c0e92eac70692d83676ea6e9456da (patch)
treef4277d0272fb706b4ed2c7ac49c5239eee41623a /servers/rendering/renderer_rd
parent7972107c48414f3f952bd669d6a18b02614b2484 (diff)
parentef246d9156dccf2c1d5e404ad83750a6efb8b4a3 (diff)
Merge pull request #70091 from clayjohn/bone-aabbs
Remove mesh bone_aabbs as they are not used anywhere and calculating them is a pain
Diffstat (limited to 'servers/rendering/renderer_rd')
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp19
-rw-r--r--servers/rendering/renderer_rd/storage_rd/mesh_storage.h2
2 files changed, 0 insertions, 21 deletions
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
index 1487336d8d..35fa3931f8 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
@@ -434,27 +434,8 @@ void MeshStorage::mesh_add_surface(RID p_mesh, const RS::SurfaceData &p_surface)
}
if (mesh->surface_count == 0) {
- mesh->bone_aabbs = p_surface.bone_aabbs;
mesh->aabb = p_surface.aabb;
} else {
- if (mesh->bone_aabbs.size() < p_surface.bone_aabbs.size()) {
- // ArrayMesh::_surface_set_data only allocates bone_aabbs up to max_bone
- // Each surface may affect different numbers of bones.
- mesh->bone_aabbs.resize(p_surface.bone_aabbs.size());
- }
- for (int i = 0; i < p_surface.bone_aabbs.size(); i++) {
- const AABB &bone = p_surface.bone_aabbs[i];
- if (bone.has_volume()) {
- AABB &mesh_bone = mesh->bone_aabbs.write[i];
- if (mesh_bone != AABB()) {
- // Already initialized, merge AABBs.
- mesh_bone.merge_with(bone);
- } else {
- // Not yet initialized, copy the bone AABB.
- mesh_bone = bone;
- }
- }
- }
mesh->aabb.merge_with(p_surface.aabb);
}
diff --git a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
index 27c82213e4..a8feddc3b9 100644
--- a/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
+++ b/servers/rendering/renderer_rd/storage_rd/mesh_storage.h
@@ -138,8 +138,6 @@ private:
Surface **surfaces = nullptr;
uint32_t surface_count = 0;
- Vector<AABB> bone_aabbs;
-
bool has_bone_weights = false;
AABB aabb;