diff --git a/interface/src/Avatar.cpp b/interface/src/Avatar.cpp index 22466ec690..6d278e641b 100644 --- a/interface/src/Avatar.cpp +++ b/interface/src/Avatar.cpp @@ -143,8 +143,7 @@ void Avatar::updateHeadFromGyros(float deltaTime, SerialInterface* serialInterfa // Update head lean distance based on accelerometer data glm::vec3 headRotationRates(_head.getPitch(), _head.getYaw(), _head.getRoll()); - - glm::vec3 leaning = (serialInterface->getLastAcceleration() - serialInterface->getGravity()) + glm::vec3 leaning = (serialInterface->getLastAcceleration() - serialInterface->getGravity()) * LEAN_SENSITIVITY * (1.f - fminf(glm::length(headRotationRates), HEAD_RATE_MAX) / HEAD_RATE_MAX); leaning.y = 0.f; diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 08e46d2271..33a5f792ee 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -210,8 +210,6 @@ void Head::renderEars() { glPopMatrix(); } - - void Head::renderMouth() { float s = sqrt(_averageLoudness); diff --git a/interface/src/SerialInterface.cpp b/interface/src/SerialInterface.cpp index 233a004568..1989736bf8 100644 --- a/interface/src/SerialInterface.cpp +++ b/interface/src/SerialInterface.cpp @@ -203,8 +203,8 @@ void SerialInterface::readData() { // Convert the integer rates to floats const float LSB_TO_DEGREES_PER_SECOND = 1.f / 16.4f; // From MPU-9150 register map, 2000 deg/sec. - _lastRollRate = ((float) rollRate) * LSB_TO_DEGREES_PER_SECOND; - _lastYawRate = ((float) yawRate) * LSB_TO_DEGREES_PER_SECOND; + _lastRollRate = ((float) -rollRate) * LSB_TO_DEGREES_PER_SECOND; + _lastYawRate = ((float) -yawRate) * LSB_TO_DEGREES_PER_SECOND; _lastPitchRate = ((float) -pitchRate) * LSB_TO_DEGREES_PER_SECOND; // Accumulate a set of initial baseline readings for setting gravity