3
0
Fork 0
mirror of https://github.com/JulianGro/overte.git synced 2025-04-15 20:32:27 +02:00

Don't include the root rot, because it seems that this is already accounted for in the head params.

Restore the hmd conditional on setting head position. This had been removed when failing to pin it cause lean.
I believe that lean was being caused by coordinate system issues that are now addressed by the above and Andrew's big cleanup.
This commit is contained in:
Howard Stearns 2015-09-22 10:12:59 -07:00
parent 8f1dde69cc
commit 7e52d38870

View file

@ -993,11 +993,13 @@ void Rig::updateNeckJoint(int index, const HeadParameters& params) {
glm::angleAxis(glm::radians(-params.localHeadPitch), X_AXIS));
_animVars.set("headRotation", realLocalHeadOrientation);
// There's a theory that when not in hmd, we should _animVars.unset("headPosition").
// However, until that works well, let's always request head be positioned where requested by hmd, camera, or default.
int headIndex = _animSkeleton->nameToJointIndex("Head");
AnimPose rootPose = _animNode->getRootPose(headIndex);
_animVars.set("headPosition", rootPose.trans + rootPose.rot * params.localHeadPosition);
if (params.isInHMD) {
int headIndex = _animSkeleton->nameToJointIndex("Head");
AnimPose rootPose = _animNode->getRootPose(headIndex);
_animVars.set("headPosition", rootPose.trans + params.localHeadPosition); // rootPose.rot is handled in params?d
} else {
_animVars.unset("headPosition");
}
} else if (!_enableAnimGraph) {
auto& state = _jointStates[index];