Skip to content

Commit

Permalink
Merge pull request #77265 from lyuma/aabb_bone_lod_inside
Browse files Browse the repository at this point in the history
Fix calculation of skinned AABB for unused bones.
  • Loading branch information
akien-mga committed May 22, 2023
2 parents 7ed55c8 + 791d800 commit 05ddc82
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions drivers/gles3/storage/mesh_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {

if (skeleton->use_2d) {
for (int j = 0; j < bs; j++) {
if (skbones[0].size == Vector3()) {
if (skbones[j].size == Vector3(-1, -1, -1)) {
continue; //bone is unused
}

Expand All @@ -561,7 +561,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
}
} else {
for (int j = 0; j < bs; j++) {
if (skbones[0].size == Vector3()) {
if (skbones[j].size == Vector3(-1, -1, -1)) {
continue; //bone is unused
}

Expand Down
4 changes: 2 additions & 2 deletions servers/rendering/renderer_rd/storage_rd/mesh_storage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -627,7 +627,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {

if (skeleton->use_2d) {
for (int j = 0; j < bs; j++) {
if (skbones[0].size == Vector3()) {
if (skbones[j].size == Vector3(-1, -1, -1)) {
continue; //bone is unused
}

Expand All @@ -654,7 +654,7 @@ AABB MeshStorage::mesh_get_aabb(RID p_mesh, RID p_skeleton) {
}
} else {
for (int j = 0; j < bs; j++) {
if (skbones[0].size == Vector3()) {
if (skbones[j].size == Vector3(-1, -1, -1)) {
continue; //bone is unused
}

Expand Down

0 comments on commit 05ddc82

Please sign in to comment.