diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index 3f3715a89b..cb1f4d671f 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -128,19 +128,19 @@ void Avatar::reset() { // Update avatar head rotation with sensor data void Avatar::updateHeadFromGyros(float deltaTime, SerialInterface* serialInterface, glm::vec3* gravity) { - float measuredPitchRate = 0.0f; - float measuredRollRate = 0.0f; - float measuredYawRate = 0.0f; + const float AMPLIFY_PITCH = 2.f; + const float AMPLIFY_YAW = 2.f; + const float AMPLIFY_ROLL = 2.f; - measuredPitchRate = serialInterface->getLastPitchRate(); - measuredYawRate = serialInterface->getLastYawRate(); - measuredRollRate = serialInterface->getLastRollRate(); + float measuredPitchRate = serialInterface->getLastPitchRate(); + float measuredYawRate = serialInterface->getLastYawRate(); + float measuredRollRate = serialInterface->getLastRollRate(); // Update avatar head position based on measured gyro rates - _head.addPitch(measuredPitchRate * deltaTime); - _head.addYaw (measuredYawRate * deltaTime); - _head.addRoll (measuredRollRate * deltaTime); + _head.addPitch(measuredPitchRate * AMPLIFY_PITCH * deltaTime); + _head.addYaw (measuredYawRate * AMPLIFY_YAW * deltaTime); + _head.addRoll (measuredRollRate * AMPLIFY_ROLL * deltaTime); // Update head lean distance based on accelerometer data glm::vec3 headRotationRates(_head.getPitch(), _head.getYaw(), _head.getRoll()); diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 33a5f792ee..cb42c6cc54 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -76,10 +76,10 @@ void Head::simulate(float deltaTime, bool isMine) { _roll *= (1.0f - HEAD_MOTION_DECAY * _returnSpringScale * deltaTime); } - // For invensense gyro, decay only slightly when roughly centered + // For invensense gyro, decay only slightly when near center (until we add fusion) if (isMine) { const float RETURN_RANGE = 15.0; - const float RETURN_STRENGTH = 2.0; + const float RETURN_STRENGTH = 0.5; if (fabs(_pitch) < RETURN_RANGE) { _pitch *= (1.0f - RETURN_STRENGTH * deltaTime); } if (fabs(_yaw ) < RETURN_RANGE) { _yaw *= (1.0f - RETURN_STRENGTH * deltaTime); } if (fabs(_roll ) < RETURN_RANGE) { _roll *= (1.0f - RETURN_STRENGTH * deltaTime); }