progress
This commit is contained in:
@@ -157,9 +157,12 @@ void PoseManager::applyPose() {
|
|||||||
osg::Quat newRot = bindRot * pose.rotation;
|
osg::Quat newRot = bindRot * pose.rotation;
|
||||||
osg::Vec3 newTrans = bindTrans + pose.translation;
|
osg::Vec3 newTrans = bindTrans + pose.translation;
|
||||||
|
|
||||||
// Build clean TRS matrix — no manual scale baking which causes shear
|
// rotate * translate is wrong (rotates around world origin).
|
||||||
bone->setMatrix(
|
// The bind matrix already encodes the local-space pivot correctly,
|
||||||
osg::Matrix::rotate(newRot) *
|
// 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));
|
osg::Matrix::translate(newTrans));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user