From b38c68ab20598c471f9971d89cb480c3b6c60ca5 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 5 Jun 2013 10:46:55 -0700 Subject: [PATCH] remove unused setHeadFromGyros() routine - confusing. --- interface/src/Avatar.cpp | 31 ------------------------------- interface/src/Avatar.h | 1 - interface/src/Head.cpp | 3 +++ 3 files changed, 3 insertions(+), 32 deletions(-) diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index d8178ca643..160f37e00f 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -1220,37 +1220,6 @@ void Avatar::renderBody(bool lookingInMirror) { -void Avatar::setHeadFromGyros(glm::vec3* eulerAngles, glm::vec3* angularVelocity, float deltaTime, float smoothingTime) { - // - // Given absolute position and angular velocity information, update the avatar's head angles - // with the goal of fast instantaneous updates that gradually follow the absolute data. - // - // Euler Angle format is (Yaw, Pitch, Roll) in degrees - // - // Angular Velocity is (Yaw, Pitch, Roll) in degrees per second - // - // SMOOTHING_TIME is the time is seconds over which the head should average to the - // absolute eulerAngles passed. - // - // - - if (deltaTime == 0.f) { - // On first sample, set head to absolute position - _head.setYaw (eulerAngles->x); - _head.setPitch(eulerAngles->y); - _head.setRoll (eulerAngles->z); - } else { - glm::vec3 angles(_head.getYaw(), _head.getPitch(), _head.getRoll()); - // Increment by detected velocity - angles += (*angularVelocity) * deltaTime; - // Smooth to slowly follow absolute values - angles = ((1.f - deltaTime / smoothingTime) * angles) + (deltaTime / smoothingTime) * (*eulerAngles); - _head.setYaw (angles.x); - _head.setPitch(angles.y); - _head.setRoll (angles.z); - // printLog("Y/P/R: %3.1f, %3.1f, %3.1f\n", angles.x, angles.y, angles.z); - } -} void Avatar::loadData(QSettings* set) { set->beginGroup("Avatar"); diff --git a/interface/src/Avatar.h b/interface/src/Avatar.h index 73ab3ddaba..8f058ed1ab 100644 --- a/interface/src/Avatar.h +++ b/interface/src/Avatar.h @@ -216,7 +216,6 @@ private: void updateCollisionWithVoxels(); void applyCollisionWithScene(const glm::vec3& penetration); void applyCollisionWithOtherAvatar( Avatar * other, float deltaTime ); - void setHeadFromGyros(glm::vec3 * eulerAngles, glm::vec3 * angularVelocity, float deltaTime, float smoothingTime); void checkForMouseRayTouching(); void renderJointConnectingCone(glm::vec3 position1, glm::vec3 position2, float radius1, float radius2); }; diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 98e5c57cb1..8317020223 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -104,6 +104,7 @@ void Head::simulate(float deltaTime, bool isMine) { const float HEAD_MOTION_DECAY = 0.00; + /* // Decay head back to center if turned on if (isMine && _returnHeadToCenter) { @@ -121,6 +122,7 @@ void Head::simulate(float deltaTime, bool isMine) { if (fabs(_yaw ) < RETURN_RANGE) { _yaw *= (1.0f - RETURN_STRENGTH * deltaTime); } if (fabs(_roll ) < RETURN_RANGE) { _roll *= (1.0f - RETURN_STRENGTH * deltaTime); } } + */ // decay lean _leanForward *= (1.f - HEAD_MOTION_DECAY * 30 * deltaTime); @@ -151,6 +153,7 @@ void Head::simulate(float deltaTime, bool isMine) { if (USING_PHYSICAL_MOHAWK) { updateHairPhysics(deltaTime); } + } void Head::determineIfLookingAtSomething() {