From dc9937e11a847b16236eea4954bccbc05b86f24d Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Tue, 30 Dec 2014 17:02:53 -0800 Subject: [PATCH] only twist own body, remove unused head functions --- interface/src/avatar/Head.cpp | 11 ++++++----- libraries/avatars/src/HeadData.cpp | 13 ------------- libraries/avatars/src/HeadData.h | 5 ----- 3 files changed, 6 insertions(+), 23 deletions(-) diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index 87185eb7eb..9923efcea3 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -89,12 +89,13 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) { _blendshapeCoefficients = faceTracker->getBlendshapeCoefficients(); } } + // Twist the upper body to follow the rotation of the head, but only do this with my avatar, + // since everyone else will see the full joint rotations for other people. + const float BODY_FOLLOW_HEAD_YAW_RATE = 0.1f; + const float BODY_FOLLOW_HEAD_FACTOR = 1.5f; + setTorsoTwist((1.0f - BODY_FOLLOW_HEAD_YAW_RATE) * getTorsoTwist() + getFinalYaw() * BODY_FOLLOW_HEAD_YAW_RATE / BODY_FOLLOW_HEAD_FACTOR); } - // Twist the upper body to follow the rotation of the head - const float BODY_FOLLOW_HEAD_YAW_RATE = 0.1f; - const float BODY_FOLLOW_HEAD_FACTOR = 1.5f; - setTorsoTwist((1.0f - BODY_FOLLOW_HEAD_YAW_RATE) * getTorsoTwist() + getFinalYaw() * BODY_FOLLOW_HEAD_YAW_RATE / BODY_FOLLOW_HEAD_FACTOR); - + // Update audio trailing average for rendering facial animations const float AUDIO_AVERAGING_SECS = 0.05f; const float AUDIO_LONG_TERM_AVERAGING_SECS = 30.0f; diff --git a/libraries/avatars/src/HeadData.cpp b/libraries/avatars/src/HeadData.cpp index 2bdb203034..511ab50c11 100644 --- a/libraries/avatars/src/HeadData.cpp +++ b/libraries/avatars/src/HeadData.cpp @@ -73,16 +73,3 @@ void HeadData::setBlendshape(QString name, float val) { _blendshapeCoefficients[it.value()] = val; } } - -void HeadData::addYaw(float yaw) { - setBaseYaw(_baseYaw + yaw); -} - -void HeadData::addPitch(float pitch) { - setBasePitch(_basePitch + pitch); -} - -void HeadData::addRoll(float roll) { - setBaseRoll(_baseRoll + roll); -} - diff --git a/libraries/avatars/src/HeadData.h b/libraries/avatars/src/HeadData.h index ea7666a6cd..3a4eb3c808 100644 --- a/libraries/avatars/src/HeadData.h +++ b/libraries/avatars/src/HeadData.h @@ -65,11 +65,6 @@ public: float getPupilDilation() const { return _pupilDilation; } void setPupilDilation(float pupilDilation) { _pupilDilation = pupilDilation; } - // degrees - void addYaw(float yaw); - void addPitch(float pitch); - void addRoll(float roll); - const glm::vec3& getLookAtPosition() const { return _lookAtPosition; } void setLookAtPosition(const glm::vec3& lookAtPosition) { _lookAtPosition = lookAtPosition; }