From e9b8e5431d2bebc74995f1a17209fece32a9bac5 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Tue, 15 Aug 2017 17:26:51 -0700 Subject: [PATCH] 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). --- libraries/animation/src/Rig.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 2eab4f9996..1b91737364 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -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(geometry);