From cff0fd470a43020148f0baf5fa8dc92d4a74a198 Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 25 Feb 2019 12:23:03 -0800 Subject: [PATCH 1/3] re-enabled ik off by default on Desktop --- libraries/animation/src/Rig.cpp | 44 +++++++++++++++++---------------- 1 file changed, 23 insertions(+), 21 deletions(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index fcf2cd28a3..372f03c163 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1064,28 +1064,30 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos t += deltaTime; - if (_enableInverseKinematics) { - _animVars.set("ikOverlayAlpha", 1.0f); - _animVars.set("splineIKEnabled", true); - _animVars.set("leftHandIKEnabled", true); - _animVars.set("rightHandIKEnabled", true); - _animVars.set("leftFootIKEnabled", true); - _animVars.set("rightFootIKEnabled", true); - _animVars.set("leftFootPoleVectorEnabled", true); - _animVars.set("rightFootPoleVectorEnabled", true); - } else { - _animVars.set("ikOverlayAlpha", 0.0f); - _animVars.set("splineIKEnabled", false); - _animVars.set("leftHandIKEnabled", false); - _animVars.set("rightHandIKEnabled", false); - _animVars.set("leftFootIKEnabled", false); - _animVars.set("rightFootIKEnabled", false); - _animVars.set("leftHandPoleVectorEnabled", false); - _animVars.set("rightHandPoleVectorEnabled", false); - _animVars.set("leftFootPoleVectorEnabled", false); - _animVars.set("rightFootPoleVectorEnabled", false); + if (_enableInverseKinematics != _lastEnableInverseKinematics) { + if (_enableInverseKinematics) { + _animVars.set("ikOverlayAlpha", 1.0f); + _animVars.set("splineIKEnabled", true); + _animVars.set("leftHandIKEnabled", true); + _animVars.set("rightHandIKEnabled", true); + _animVars.set("leftFootIKEnabled", true); + _animVars.set("rightFootIKEnabled", true); + _animVars.set("leftFootPoleVectorEnabled", true); + _animVars.set("rightFootPoleVectorEnabled", true); + } else { + _animVars.set("ikOverlayAlpha", 0.0f); + _animVars.set("splineIKEnabled", false); + _animVars.set("leftHandIKEnabled", false); + _animVars.set("rightHandIKEnabled", false); + _animVars.set("leftFootIKEnabled", false); + _animVars.set("rightFootIKEnabled", false); + _animVars.set("leftHandPoleVectorEnabled", false); + _animVars.set("rightHandPoleVectorEnabled", false); + _animVars.set("leftFootPoleVectorEnabled", false); + _animVars.set("rightFootPoleVectorEnabled", false); + } + _lastEnableInverseKinematics = _enableInverseKinematics; } - _lastEnableInverseKinematics = _enableInverseKinematics; } _lastForward = forward; _lastPosition = worldPosition; From 363c0cc26f55a7573f997cc8c0dfe91459b3d87b Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 25 Feb 2019 13:03:28 -0800 Subject: [PATCH 2/3] moved the update of last ik to outside the if changed statement --- libraries/animation/src/Rig.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 372f03c163..fb7bb15341 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1086,8 +1086,8 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos _animVars.set("leftFootPoleVectorEnabled", false); _animVars.set("rightFootPoleVectorEnabled", false); } - _lastEnableInverseKinematics = _enableInverseKinematics; } + _lastEnableInverseKinematics = _enableInverseKinematics; } _lastForward = forward; _lastPosition = worldPosition; From 12dbaa0ea0698ebe4798605956e15695f0896e74 Mon Sep 17 00:00:00 2001 From: amantley Date: Mon, 25 Feb 2019 14:56:03 -0800 Subject: [PATCH 3/3] changed the condition so that you can turn off ik in hmd mode if you want to for debug purposes --- libraries/animation/src/Rig.cpp | 35 ++++++++++++--------------------- 1 file changed, 13 insertions(+), 22 deletions(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index fb7bb15341..25f154e9fd 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1064,28 +1064,19 @@ void Rig::computeMotionAnimationState(float deltaTime, const glm::vec3& worldPos t += deltaTime; - if (_enableInverseKinematics != _lastEnableInverseKinematics) { - if (_enableInverseKinematics) { - _animVars.set("ikOverlayAlpha", 1.0f); - _animVars.set("splineIKEnabled", true); - _animVars.set("leftHandIKEnabled", true); - _animVars.set("rightHandIKEnabled", true); - _animVars.set("leftFootIKEnabled", true); - _animVars.set("rightFootIKEnabled", true); - _animVars.set("leftFootPoleVectorEnabled", true); - _animVars.set("rightFootPoleVectorEnabled", true); - } else { - _animVars.set("ikOverlayAlpha", 0.0f); - _animVars.set("splineIKEnabled", false); - _animVars.set("leftHandIKEnabled", false); - _animVars.set("rightHandIKEnabled", false); - _animVars.set("leftFootIKEnabled", false); - _animVars.set("rightFootIKEnabled", false); - _animVars.set("leftHandPoleVectorEnabled", false); - _animVars.set("rightHandPoleVectorEnabled", false); - _animVars.set("leftFootPoleVectorEnabled", false); - _animVars.set("rightFootPoleVectorEnabled", false); - } + if (_enableInverseKinematics) { + _animVars.set("ikOverlayAlpha", 1.0f); + } else { + _animVars.set("ikOverlayAlpha", 0.0f); + _animVars.set("splineIKEnabled", false); + _animVars.set("leftHandIKEnabled", false); + _animVars.set("rightHandIKEnabled", false); + _animVars.set("leftFootIKEnabled", false); + _animVars.set("rightFootIKEnabled", false); + _animVars.set("leftHandPoleVectorEnabled", false); + _animVars.set("rightHandPoleVectorEnabled", false); + _animVars.set("leftFootPoleVectorEnabled", false); + _animVars.set("rightFootPoleVectorEnabled", false); } _lastEnableInverseKinematics = _enableInverseKinematics; }