Skip to content

Commit b27afca

Browse files
make the joints affected by bones not contribute to meshbuffer's static AABB
1 parent 484c1f2 commit b27afca

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

include/nbl/asset/utils/IMeshManipulator.h

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,8 @@ class IMeshManipulator : public virtual core::IReferenceCounted
391391
else
392392
ix = indexPtr[j];
393393
const auto pos = meshbuffer->getPosition(ix);
394-
394+
395+
bool noJointInfluence = true;
395396
if constexpr (!std::is_void_v<std::remove_pointer_t<decltype(jointAABBs)>>)
396397
{
397398
uint32_t jointIDs[4u];
@@ -407,12 +408,14 @@ class IMeshManipulator : public virtual core::IReferenceCounted
407408
core::vectorSIMDf boneSpacePos;
408409
inverseBindPoses[i].transformVect(boneSpacePos,pos);
409410
jointAABBs[jointIDs[i]].addInternalPoint(boneSpacePos.getAsVector3df());
411+
noJointInfluence = false;
410412
}
411413
weightRemainder -= weights[i];
412414
}
413415
}
414-
415-
aabb.addInternalPoint(pos.getAsVector3df());
416+
417+
if (noJointInfluence)
418+
aabb.addInternalPoint(pos.getAsVector3df());
416419
}
417420
};
418421

0 commit comments

Comments
 (0)