From a625304bfb40b1e23a91ba484417faec92c6a048 Mon Sep 17 00:00:00 2001 From: owner Date: Mon, 16 Mar 2026 03:51:03 -0400 Subject: [PATCH] progress --- src/PoseManager.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/PoseManager.cpp b/src/PoseManager.cpp index 41351b6..b1a0412 100644 --- a/src/PoseManager.cpp +++ b/src/PoseManager.cpp @@ -157,9 +157,12 @@ void PoseManager::applyPose() { osg::Quat newRot = bindRot * pose.rotation; osg::Vec3 newTrans = bindTrans + pose.translation; - // Build clean TRS matrix — no manual scale baking which causes shear - bone->setMatrix( - osg::Matrix::rotate(newRot) * + // rotate * translate is wrong (rotates around world origin). + // The bind matrix already encodes the local-space pivot correctly, + // so just pre-multiply the bind matrix by the rotation delta. + // This rotates the bone around its own local origin (joint pivot). + osg::Matrix rotDelta; rotDelta.makeRotate(pose.rotation); + bone->setMatrix(rotDelta * bind); osg::Matrix::translate(newTrans)); } } \ No newline at end of file