Merge pull request #77265 from lyuma/aabb_bone_lod_inside

Fix calculation of skinned AABB for unused bones.
This commit is contained in:
Rémi Verschelde 2023-05-22 13:49:19 +02:00
commit 05ddc822fb
No known key found for this signature in database
GPG key ID: C3336907360768E1
2 changed files with 4 additions and 4 deletions

View file

@ -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
}
@ -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
}

View file

@ -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
}
@ -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
}