From 6323f49f26217f39aeda8dde12c68213e7add993 Mon Sep 17 00:00:00 2001 From: amantley Date: Thu, 21 Feb 2019 14:36:05 -0800 Subject: [PATCH] changed the define variable to HIFI_USE_OPTIMIZED_IK --- CMakeLists.txt | 12 +- interface/src/avatar/MyAvatar.cpp | 2 +- interface/src/avatar/MySkeletonModel.cpp | 4 +- libraries/animation/src/Rig.cpp | 334 ----------------------- libraries/animation/src/Rig.h | 14 - 5 files changed, 8 insertions(+), 358 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 5bd4d4620b..f88f8fbff7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -52,7 +52,7 @@ else() set(MOBILE 0) endif() -set(HIFI_USE_Q_OS_ANDROID_OPTION OFF) +set(HIFI_USE_OPTIMIZED_IK OFF) set(BUILD_CLIENT_OPTION ON) set(BUILD_SERVER_OPTION ON) set(BUILD_TESTS_OPTION OFF) @@ -109,7 +109,7 @@ if (USE_GLES AND (NOT ANDROID)) set(DISABLE_QML_OPTION ON) endif() -option(HIFI_USE_Q_OS_ANDROID "USE OPTIMIZED IK" ${HIFI_USE_Q_OS_ANDROID_OPTION}) +option(HIFI_USE_OPTIMIZED_IK "USE OPTIMIZED IK" ${HIFI_USE_OPTIMIZED_IK_OPTION}) option(BUILD_CLIENT "Build client components" ${BUILD_CLIENT_OPTION}) option(BUILD_SERVER "Build server components" ${BUILD_SERVER_OPTION}) option(BUILD_TESTS "Build tests" ${BUILD_TESTS_OPTION}) @@ -140,7 +140,7 @@ foreach(PLATFORM_QT_COMPONENT ${PLATFORM_QT_COMPONENTS}) list(APPEND PLATFORM_QT_LIBRARIES "Qt5::${PLATFORM_QT_COMPONENT}") endforeach() -MESSAGE(STATUS "USE OPTIMIZED IK: " ${HIFI_USE_Q_OS_ANDROID}) +MESSAGE(STATUS "USE OPTIMIZED IK: " ${HIFI_USE_OPTIMIZED_IK}) MESSAGE(STATUS "Build server: " ${BUILD_SERVER}) MESSAGE(STATUS "Build client: " ${BUILD_CLIENT}) MESSAGE(STATUS "Build tests: " ${BUILD_TESTS}) @@ -186,11 +186,9 @@ find_package( Threads ) add_definitions(-DGLM_FORCE_RADIANS) add_definitions(-DGLM_ENABLE_EXPERIMENTAL) add_definitions(-DGLM_FORCE_CTOR_INIT) -#add_definitions(-DHIFI_USE_Q_OS_ANDROID) -#option(HIFI_USE_Q_OS_ANDROID_OPTION "hifi_use_optimized_ik" OFF) -if (HIFI_USE_Q_OS_ANDROID) +if (HIFI_USE_OPTIMIZED_IK) MESSAGE(STATUS "SET THE USE IK DEFINITION ") - add_definitions(-DHIFI_USE_Q_OS_ANDROID) + add_definitions(-DHIFI_USE_OPTIMIZED_IK) endif() set(HIFI_LIBRARY_DIR "${CMAKE_CURRENT_SOURCE_DIR}/libraries") diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 5bccd4650b..ff865172ae 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -2952,7 +2952,7 @@ void MyAvatar::initAnimGraph() { } else { graphUrl = PathUtils::resourcesUrl("avatar/avatar-animation.json"); -#if defined(Q_OS_ANDROID) || defined(HIFI_USE_Q_OS_ANDROID) +#if defined(Q_OS_ANDROID) || defined(HIFI_USE_OPTIMIZED_IK) graphUrl = PathUtils::resourcesUrl("avatar/avatar-animation_withSplineIKNode.json"); #endif } diff --git a/interface/src/avatar/MySkeletonModel.cpp b/interface/src/avatar/MySkeletonModel.cpp index 58071cfab1..13cdedc830 100755 --- a/interface/src/avatar/MySkeletonModel.cpp +++ b/interface/src/avatar/MySkeletonModel.cpp @@ -252,7 +252,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { AnimPose headAvatarSpace(avatarHeadPose.getRotation(), avatarHeadPose.getTranslation()); AnimPose headRigSpace = avatarToRigPose * headAvatarSpace; AnimPose hipsRigSpace = sensorToRigPose * sensorHips; -#if defined(Q_OS_ANDROID) || defined(HIFI_USE_Q_OS_ANDROID) +#if defined(Q_OS_ANDROID) || defined(HIFI_USE_OPTIMIZED_IK) glm::vec3 spine2TargetTranslation = computeSpine2WithHeadHipsSpline(myAvatar, hipsRigSpace, headRigSpace); #endif const float SPINE2_ROTATION_FILTER = 0.5f; @@ -276,7 +276,7 @@ void MySkeletonModel::updateRig(float deltaTime, glm::mat4 parentTransform) { } generateBasisVectors(up, fwd, u, v, w); AnimPose newSpinePose(glm::mat4(glm::vec4(w, 0.0f), glm::vec4(u, 0.0f), glm::vec4(v, 0.0f), glm::vec4(glm::vec3(0.0f, 0.0f, 0.0f), 1.0f))); -#if defined(Q_OS_ANDROID) || defined(HIFI_USE_Q_OS_ANDROID) +#if defined(Q_OS_ANDROID) || defined(HIFI_USE_OPTIMIZED_IK) currentSpine2Pose.trans() = spine2TargetTranslation; #endif currentSpine2Pose.rot() = safeLerp(currentSpine2Pose.rot(), newSpinePose.rot(), SPINE2_ROTATION_FILTER); diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 93c9c0cd1b..be6240017f 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -1459,12 +1459,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab int oppositeArmJointIndex = _animSkeleton->nameToJointIndex("RightArm"); if (ENABLE_POLE_VECTORS && handJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0 && oppositeArmJointIndex >= 0) { glm::vec3 poleVector; -#if defined(Q_OS_ANDROID) || defined(HIFI_USE_Q_OS_ANDROID) - bool isLeft = true; - bool usePoleVector = calculateElbowPoleVectorOptimized(handJointIndex, elbowJointIndex, armJointIndex, isLeft, poleVector); -#else bool usePoleVector = calculateElbowPoleVector(handJointIndex, elbowJointIndex, armJointIndex, oppositeArmJointIndex, poleVector); -#endif if (usePoleVector) { glm::vec3 sensorPoleVector = transformVectorFast(rigToSensorMatrix, poleVector); _animVars.set("leftHandPoleVectorEnabled", true); @@ -1519,12 +1514,7 @@ void Rig::updateHands(bool leftHandEnabled, bool rightHandEnabled, bool hipsEnab if (ENABLE_POLE_VECTORS && handJointIndex >= 0 && armJointIndex >= 0 && elbowJointIndex >= 0 && oppositeArmJointIndex >= 0) { glm::vec3 poleVector; -#if defined(Q_OS_ANDROID) || defined(HIFI_USE_Q_OS_ANDROID) - bool isLeft = false; - bool usePoleVector = calculateElbowPoleVectorOptimized(handJointIndex, elbowJointIndex, armJointIndex, isLeft, poleVector); -#else bool usePoleVector = calculateElbowPoleVector(handJointIndex, elbowJointIndex, armJointIndex, oppositeArmJointIndex, poleVector); -#endif if (usePoleVector) { glm::vec3 sensorPoleVector = transformVectorFast(rigToSensorMatrix, poleVector); _animVars.set("rightHandPoleVectorEnabled", true); @@ -1690,330 +1680,6 @@ void Rig::updateEyeJoint(int index, const glm::vec3& modelTranslation, const glm } } -static float getHandPositionTheta(glm::vec3 armToHand, float defaultArmLength, bool left) { - float handPositionTheta = 0.0f; - //calculate the hand position influence on theta - const float zStart = 0.6f; - const float xStart = 0.1f; - // biases - const glm::vec3 biases(0.0f, 135.0f, 0.0f); - // weights - const float zWeightBottom = -100.0f; - const glm::vec3 weights(-50.0f, 60.0f, 90.0f); - - float yFactor = (fabsf(armToHand[1] / defaultArmLength) * weights[1]) + biases[1]; - - float zFactor; - if (armToHand[1] > 0.0f) { - zFactor = weights[2] * glm::max(zStart - (armToHand[2] / defaultArmLength), 0.0f) * glm::max(fabsf((armToHand[1] - 0.1f) / defaultArmLength), 0.0f); - } else { - zFactor = zWeightBottom * glm::max(zStart - (armToHand[2] / defaultArmLength), 0.0f) * fabsf(armToHand[1] / defaultArmLength); - } - - float xFactor; - if (left) { - xFactor = weights[0] * ((-1.0f * (armToHand[0] / defaultArmLength) + xStart) - (0.2f) * ((1.0f + (armToHand[1] / defaultArmLength)) / 2.0f)); - } else { - xFactor = weights[0] * (((armToHand[0] / defaultArmLength) + xStart) - (0.2f) * ((1.0f + (armToHand[1] / defaultArmLength)) / 2.0f)); - } - - handPositionTheta = xFactor + yFactor + zFactor; - - const float LOWER_ANATOMICAL_ANGLE = 175.0f; - const float UPPER_ANATOMICAL_ANGLE = 50.0f; - if (handPositionTheta > LOWER_ANATOMICAL_ANGLE) { - handPositionTheta = LOWER_ANATOMICAL_ANGLE; - } - if (handPositionTheta < UPPER_ANATOMICAL_ANGLE) { - handPositionTheta = UPPER_ANATOMICAL_ANGLE; - } - - if (left) { - handPositionTheta *= -1.0f; - } - - return handPositionTheta; -} - -static float computeUlnarRadialCompensation(float ulnarRadialTheta, float twistTheta, bool left) { - const float ULNAR_BOUNDARY_MINUS = -PI / 4.0f; - const float ULNAR_BOUNDARY_PLUS = -PI / 4.0f; - float ulnarDiff = 0.0f; - float ulnarCorrection = 0.0f; - float currentWristCoefficient = 0.0f; - if (left) { - if (ulnarRadialTheta > -ULNAR_BOUNDARY_MINUS) { - ulnarDiff = ulnarRadialTheta - (-ULNAR_BOUNDARY_MINUS); - } else if (ulnarRadialTheta < -ULNAR_BOUNDARY_PLUS) { - ulnarDiff = ulnarRadialTheta - (-ULNAR_BOUNDARY_PLUS); - } - } else { - if (ulnarRadialTheta > ULNAR_BOUNDARY_MINUS) { - ulnarDiff = ulnarRadialTheta - ULNAR_BOUNDARY_MINUS; - } else if (ulnarRadialTheta < ULNAR_BOUNDARY_PLUS) { - ulnarDiff = ulnarRadialTheta - ULNAR_BOUNDARY_PLUS; - } - - } - if (fabsf(ulnarDiff) > 0.0f) { - float twistCoefficient = 0.0f; - - if (left) { - twistCoefficient = twistTheta; - if (twistCoefficient > (PI / 6.0f)) { - twistCoefficient = 1.0f; - } else { - twistCoefficient = 0.0f; - } - } else { - twistCoefficient = twistTheta; - if (twistCoefficient < (-PI / 6.0f)) { - twistCoefficient = 1.0f; - } else { - twistCoefficient = 0.0f; - } - - } - - if (twistTheta < 0.0f) { - if (left) { - ulnarCorrection -= glm::sign(ulnarDiff) * (fabsf(ulnarDiff) / PI) * 180.0f * twistCoefficient; - } else { - ulnarCorrection += glm::sign(ulnarDiff) * (fabsf(ulnarDiff) / PI) * 180.0f * twistCoefficient; - } - } else { - if (left) { - ulnarCorrection += glm::sign(ulnarDiff) * (fabsf(ulnarDiff) / PI) * 180.0f * twistCoefficient; - } else { - ulnarCorrection -= glm::sign(ulnarDiff) * (fabsf(ulnarDiff) / PI) * 180.0f * twistCoefficient; - } - } - if (fabsf(ulnarCorrection) > 100.0f) { - ulnarCorrection = glm::sign(ulnarCorrection) * 100.0f; - } - currentWristCoefficient += ulnarCorrection; - } - - return currentWristCoefficient; - - -} - -static float computeTwistCompensation(float twistTheta, bool left) { - - const float TWIST_DEADZONE = PI / 2.0f; - float twistCorrection = 0.0f; - - if (fabsf(twistTheta) > TWIST_DEADZONE) { - twistCorrection = glm::sign(twistTheta) * ((fabsf(twistTheta) - TWIST_DEADZONE) / PI) * 90.0f; - } - // limit the twist correction - if (fabsf(twistCorrection) > 30.0f) { - twistCorrection = glm::sign(twistCorrection) * 30.0f; - } - - return twistCorrection; -} - -static float computeFlexCompensation(float flexTheta, bool left) { - - const float FLEX_BOUNDARY = PI / 6.0f; - const float EXTEND_BOUNDARY = -PI / 4.0f; - float flexCorrection = 0.0f; - float currentWristCoefficient = 0.0f; - - if (flexTheta > FLEX_BOUNDARY) { - flexCorrection = ((flexTheta - FLEX_BOUNDARY) / PI) * 60.0f; - } else if (flexTheta < EXTEND_BOUNDARY) { - flexCorrection = ((flexTheta - EXTEND_BOUNDARY) / PI) * 60.0f; - } - if (fabsf(flexCorrection) > 175.0f) { - flexCorrection = glm::sign(flexCorrection) * 175.0f; - } - if (left) { - currentWristCoefficient += flexCorrection; - } else { - currentWristCoefficient -= flexCorrection; - } - - return currentWristCoefficient; - -} - -static float getAxisThetaFromRotation(glm::vec3 axis, glm::quat rotation) { - - //get the flex/extension of the wrist rotation - glm::quat rotationAboutTheAxis; - glm::quat rotationOrthoganalToAxis; - swingTwistDecomposition(rotation, axis, rotationOrthoganalToAxis, rotationAboutTheAxis); - if (rotationAboutTheAxis.w < 0.0f) { - rotationAboutTheAxis *= -1.0f; - } - glm::vec3 rotAxis = glm::axis(rotationAboutTheAxis); - float axisTheta = glm::sign(glm::dot(rotAxis, axis)) * glm::angle(rotationAboutTheAxis); - - return axisTheta; -} - -bool Rig::calculateElbowPoleVectorOptimized(int handIndex, int elbowIndex, int shoulderIndex, bool left, glm::vec3& poleVector) { - - AnimPose handPose = _externalPoseSet._absolutePoses[handIndex]; - AnimPose shoulderPose = _externalPoseSet._absolutePoses[shoulderIndex]; - AnimPose elbowPose = _externalPoseSet._absolutePoses[elbowIndex]; - - AnimPose absoluteShoulderPose = getAbsoluteDefaultPose(shoulderIndex); - AnimPose absoluteHandPose = getAbsoluteDefaultPose(handIndex); - float defaultArmLength = glm::length(absoluteHandPose.trans() - absoluteShoulderPose.trans()); - - glm::vec3 armToHand = handPose.trans() - shoulderPose.trans(); - glm::vec3 unitAxis; - float axisLength = glm::length(armToHand); - if (axisLength > 0.0f) { - unitAxis = armToHand / axisLength; - } else { - unitAxis = Vectors::UNIT_Y; - } - - if ((armToHand.z < 0.0f) && (armToHand.y < 0.0f)) { - // turn off the poleVector when the hand is back and down - return false; - } - - // get the pole vector theta based on the hand position relative to the shoulder. - float positionalTheta = getHandPositionTheta(armToHand, defaultArmLength, left); - - // now we calculate the contribution of the hand rotation relative to the arm - glm::quat relativeHandRotation = (elbowPose.inverse() * handPose).rot(); - if (relativeHandRotation.w < 0.0f) { - relativeHandRotation *= -1.0f; - } - - // find the thetas, hand relative to avatar arm - const glm::vec3 ULNAR_ROTATION_AXIS = Vectors::UNIT_Z; - const glm::vec3 TWIST_ROTATION_AXIS = Vectors::UNIT_Y; - const glm::vec3 FLEX__ROTATION_AXIS = Vectors::UNIT_X; - - float ulnarDeviationTheta = getAxisThetaFromRotation(ULNAR_ROTATION_AXIS, relativeHandRotation); - float flexTheta = getAxisThetaFromRotation(FLEX__ROTATION_AXIS, relativeHandRotation); - float trueTwistTheta = getAxisThetaFromRotation(TWIST_ROTATION_AXIS, relativeHandRotation); - - const float HALFWAY_ANGLE = PI / 2.0f; - const float SMOOTHING_COEFFICIENT = 0.5f; - if (left) { - - if (glm::sign(ulnarDeviationTheta) != glm::sign(_ulnarRadialThetaRunningAverageLeft) && fabsf(ulnarDeviationTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. ie don't go from 179 to -179 degrees - ulnarDeviationTheta = -1.0f * ulnarDeviationTheta; - } - if (glm::sign(flexTheta) != glm::sign(_flexThetaRunningAverageLeft) && fabsf(flexTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. - flexTheta = -1.0f * flexTheta; - } - if (glm::sign(trueTwistTheta) != glm::sign(_twistThetaRunningAverageLeft) && fabsf(trueTwistTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. - trueTwistTheta = -1.0f * trueTwistTheta; - } - - // put some smoothing on the thetas - _ulnarRadialThetaRunningAverageLeft = ulnarDeviationTheta; - _flexThetaRunningAverageLeft = SMOOTHING_COEFFICIENT * _flexThetaRunningAverageLeft + (1.0f - SMOOTHING_COEFFICIENT) * flexTheta; - _twistThetaRunningAverageLeft = SMOOTHING_COEFFICIENT * _twistThetaRunningAverageLeft + (1.0f - SMOOTHING_COEFFICIENT) * trueTwistTheta; - - } else { - - if (glm::sign(ulnarDeviationTheta) != glm::sign(_ulnarRadialThetaRunningAverageRight) && fabsf(ulnarDeviationTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. ie don't go from 179 to -179 degrees - ulnarDeviationTheta = -1.0f * ulnarDeviationTheta; - } - if (glm::sign(flexTheta) != glm::sign(_flexThetaRunningAverageRight) && fabsf(flexTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. - flexTheta = -1.0f * flexTheta; - } - if (glm::sign(trueTwistTheta) != glm::sign(_twistThetaRunningAverageRight) && fabsf(trueTwistTheta) > HALFWAY_ANGLE) { - // don't allow the theta to cross the 180 degree limit. - trueTwistTheta = -1.0f * trueTwistTheta; - } - - // put some smoothing on the thetas - _twistThetaRunningAverageRight = SMOOTHING_COEFFICIENT * _twistThetaRunningAverageRight + (1.0f - SMOOTHING_COEFFICIENT) * trueTwistTheta; - _flexThetaRunningAverageRight = SMOOTHING_COEFFICIENT * _flexThetaRunningAverageRight + (1.0f - SMOOTHING_COEFFICIENT) * flexTheta; - _ulnarRadialThetaRunningAverageRight = ulnarDeviationTheta; - } - - // get the correction angle for each axis and add it to the base pole vector theta - float currentWristCoefficient = 0.0f; - if (left) { - currentWristCoefficient += computeTwistCompensation(_twistThetaRunningAverageLeft, left); - currentWristCoefficient += computeFlexCompensation(_flexThetaRunningAverageLeft, left); - //currentWristCoefficient += computeUlnarRadialCompensation(_ulnarRadialThetaRunningAverageLeft, _twistThetaRunningAverageLeft, left); - } else { - currentWristCoefficient += computeTwistCompensation(_twistThetaRunningAverageRight, left); - currentWristCoefficient += computeFlexCompensation(_flexThetaRunningAverageRight, left); - //currentWristCoefficient += computeUlnarRadialCompensation(_ulnarRadialThetaRunningAverageRight, _twistThetaRunningAverageRight, left); - } - - // find the previous contribution of the wrist and add the current wrist correction to it - if (left) { - _lastWristCoefficientLeft = _lastThetaLeft - _lastPositionThetaLeft; - _lastWristCoefficientLeft += currentWristCoefficient; - _lastPositionThetaLeft = positionalTheta; - _lastThetaLeft = positionalTheta + _lastWristCoefficientLeft; - } else { - _lastWristCoefficientRight = _lastThetaRight - _lastPositionThetaRight; - _lastWristCoefficientRight += currentWristCoefficient; - _lastPositionThetaRight = positionalTheta; - _lastThetaRight = positionalTheta + _lastWristCoefficientRight; - } - - // limit the correction anatomically possible angles and change to radians - const float LOWER_ANATOMICAL_ANGLE = 175.0f; - const float UPPER_ANATOMICAL_ANGLE = 50.0f; - - // make the lower boundary vary with the body - float lowerBoundary = LOWER_ANATOMICAL_ANGLE; - if (fabsf(positionalTheta) < LOWER_ANATOMICAL_ANGLE) { - lowerBoundary = positionalTheta; - } - float thetaRadians = 0.0f; - if (left) { - - if (_lastThetaLeft > -UPPER_ANATOMICAL_ANGLE) { - _lastThetaLeft = -UPPER_ANATOMICAL_ANGLE; - } - if (_lastThetaLeft < lowerBoundary) { - _lastThetaLeft = lowerBoundary; - } - // convert to radians and make 180 0 to match pole vector theta - thetaRadians = ((180.0f - _lastThetaLeft) / 180.0f)*PI; - } else { - - if (_lastThetaRight < UPPER_ANATOMICAL_ANGLE) { - _lastThetaRight = UPPER_ANATOMICAL_ANGLE; - } - if (_lastThetaRight > lowerBoundary) { - _lastThetaRight = lowerBoundary; - } - // convert to radians and make 180 0 to match pole vector theta - thetaRadians = ((180.0f - _lastThetaRight) / 180.0f)*PI; - } - - // convert the final theta to a pole vector value - float poleVectorXValue = -1.0f * sinf(thetaRadians); - float poleVectorYValue = -1.0f * cosf(thetaRadians); - float poleVectorZValue = 0.0f; - glm::vec3 thetaVector(poleVectorXValue, poleVectorYValue, poleVectorZValue); - - glm::vec3 up = Vectors::UNIT_Y; - glm::vec3 fwd = armToHand/glm::length(armToHand); - glm::vec3 u, v, w; - - generateBasisVectors(fwd, up, u, v, w); - AnimPose armAxisPose(glm::mat4(glm::vec4(-w, 0.0f), glm::vec4(v, 0.0f), glm::vec4(u, 0.0f), glm::vec4(glm::vec3(0.0f, 0.0f, 0.0f), 1.0f))); - poleVector = armAxisPose * thetaVector; - - return true; -} - bool Rig::calculateElbowPoleVector(int handIndex, int elbowIndex, int armIndex, int oppositeArmIndex, glm::vec3& poleVector) const { // The resulting Pole Vector is calculated as the sum of a three vectors. // The first is the vector with direction shoulder-hand. The module of this vector is inversely proportional to the strength of the resulting Pole Vector. diff --git a/libraries/animation/src/Rig.h b/libraries/animation/src/Rig.h index 6f1a5906bb..41c25a3c3e 100644 --- a/libraries/animation/src/Rig.h +++ b/libraries/animation/src/Rig.h @@ -258,7 +258,6 @@ protected: void calcAnimAlpha(float speed, const std::vector& referenceSpeeds, float* alphaOut) const; bool calculateElbowPoleVector(int handIndex, int elbowIndex, int armIndex, int oppositeArmIndex, glm::vec3& poleVector) const; - bool calculateElbowPoleVectorOptimized(int handIndex, int elbowIndex, int shoulderIndex, bool left, glm::vec3& poleVector); glm::vec3 calculateKneePoleVector(int footJointIndex, int kneeJoint, int upLegIndex, int hipsIndex, const AnimPose& targetFootPose) const; glm::vec3 deflectHandFromTorso(const glm::vec3& handPosition, const HFMJointShapeInfo& hipsShapeInfo, const HFMJointShapeInfo& spineShapeInfo, const HFMJointShapeInfo& spine1ShapeInfo, const HFMJointShapeInfo& spine2ShapeInfo) const; @@ -420,19 +419,6 @@ protected: bool _computeNetworkAnimation { false }; bool _sendNetworkNode { false }; - float _twistThetaRunningAverageLeft { 0.0f }; - float _flexThetaRunningAverageLeft { 0.0f }; - float _ulnarRadialThetaRunningAverageLeft { 0.0f }; - float _twistThetaRunningAverageRight { 0.0f }; - float _flexThetaRunningAverageRight { 0.0f }; - float _ulnarRadialThetaRunningAverageRight { 0.0f }; - float _lastThetaLeft { 0.0f }; - float _lastThetaRight { 0.0f }; - float _lastWristCoefficientRight { 0.0f }; - float _lastWristCoefficientLeft { 0.0f }; - float _lastPositionThetaLeft { 0.0f }; - float _lastPositionThetaRight { 0.0f }; - AnimContext _lastContext; AnimVariantMap _lastAnimVars;