From 37540c79b34f39377088f4367fb253ba62056f27 Mon Sep 17 00:00:00 2001 From: amantley Date: Wed, 25 Jul 2018 10:51:19 -0700 Subject: [PATCH] removed print statement and added const upper leg fraction --- interface/src/avatar/MyAvatar.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/MyAvatar.cpp b/interface/src/avatar/MyAvatar.cpp index 1dc4e82acc..c9e268f418 100755 --- a/interface/src/avatar/MyAvatar.cpp +++ b/interface/src/avatar/MyAvatar.cpp @@ -3103,11 +3103,12 @@ glm::vec3 MyAvatar::computeCounterBalance() { glm::vec3 counterBalancedCg = (1.0f / DEFAULT_AVATAR_HIPS_MASS) * counterBalancedForHead; // find the height of the hips + const float UPPER_LEG_FRACTION = 0.3333f; glm::vec3 xzDiff((cgHeadMass.position.x - counterBalancedCg.x), 0.0f, (cgHeadMass.position.z - counterBalancedCg.z)); float headMinusHipXz = glm::length(xzDiff); float headHipDefault = glm::length(tposeHead - tposeHips); float hipFootDefault = glm::length(tposeHips - tposeRightFoot); - float sitSquatThreshold = tposeHips.y - (0.333f)*hipFootDefault; + float sitSquatThreshold = tposeHips.y - (UPPER_LEG_FRACTION*hipFootDefault); float hipHeight = 0.0f; if (headHipDefault > headMinusHipXz) { hipHeight = sqrtf((headHipDefault * headHipDefault) - (headMinusHipXz * headMinusHipXz)); @@ -3120,11 +3121,9 @@ glm::vec3 MyAvatar::computeCounterBalance() { // if the height is higher than default hips, clamp to default hips counterBalancedCg.y = tposeHips.y + 0.05f; } else if (counterBalancedCg.y < sitSquatThreshold) { - //do a height reset + //do a height reset setResetMode(true); _follow.activate(FollowHelper::Vertical); - qCDebug(interfaceapp) << "doing a reset for sitting"; - } return counterBalancedCg; }