Fix for incorrectly scaled bounding volumes when switching avatars

Make sure to explicitly set the _geometryToRigTransform in Rig::initJointStates().

This should fix small bounding volume when switching from the Gamebot avatar (which has 0.008 scaling)
to another avatar (which ususally have 0.01 scaling).
This commit is contained in:
Anthony J. Thibault 2017-08-15 17:26:51 -07:00
parent f46198c2fd
commit e9b8e5431d

View file

@ -168,6 +168,8 @@ void Rig::destroyAnimGraph() {
void Rig::initJointStates(const FBXGeometry& geometry, const glm::mat4& modelOffset) {
_geometryOffset = AnimPose(geometry.offset);
_invGeometryOffset = _geometryOffset.inverse();
_geometryToRigTransform = modelOffset * geometry.offset;
_rigToGeometryTransform = glm::inverse(_geometryToRigTransform);
setModelOffset(modelOffset);
_animSkeleton = std::make_shared<AnimSkeleton>(geometry);