From 33f95c696bafbcab9242ae06c9420702b73b8cc4 Mon Sep 17 00:00:00 2001 From: Philip Rosedale Date: Wed, 24 Apr 2013 13:12:08 -0700 Subject: [PATCH] Fixes per code review --- interface/src/Audio.cpp | 2 +- interface/src/Audio.h | 2 +- interface/src/Head.cpp | 11 +++-------- interface/src/main.cpp | 4 +--- 4 files changed, 6 insertions(+), 13 deletions(-) diff --git a/interface/src/Audio.cpp b/interface/src/Audio.cpp index 17bb5c310b..287325c090 100644 --- a/interface/src/Audio.cpp +++ b/interface/src/Audio.cpp @@ -510,7 +510,7 @@ error: } -const float Audio::getInputLoudness() { +float Audio::getInputLoudness() const { return audioData->lastInputLoudness; } diff --git a/interface/src/Audio.h b/interface/src/Audio.h index 3e74596402..f4bf594b0c 100644 --- a/interface/src/Audio.h +++ b/interface/src/Audio.h @@ -25,7 +25,7 @@ public: bool getMixerLoopbackFlag(); void setMixerLoopbackFlag(bool newMixerLoopbackFlag); - const float getInputLoudness(); + float getInputLoudness() const; void updateMixerParams(in_addr_t mixerAddress, in_port_t mixerPort); void setWalkingState(bool newWalkState); diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index 896562b21e..0a632b4a6b 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -567,12 +567,9 @@ void Head::simulate(float deltaTime) { } } - // // Update audio trailing average for rendering facial animations - // - const float AUDIO_AVERAGING_SECS = 0.05; - _head.averageLoudness = (1.f - deltaTime / AUDIO_AVERAGING_SECS)*_head.averageLoudness + + _head.averageLoudness = (1.f - deltaTime / AUDIO_AVERAGING_SECS) * _head.averageLoudness + (deltaTime / AUDIO_AVERAGING_SECS) * _audioLoudness; } @@ -748,11 +745,9 @@ void Head::renderHead(bool lookingInMirror) { } glPopMatrix(); - // + // Update audio attack data for facial animation (eyebrows and mouth) - // - - _head.audioAttack = 0.9 * _head.audioAttack + 0.1 * fabs(_audioLoudness - _head.lastLoudness); + _head.audioAttack = 0.9 * _head.audioAttack + 0.1 * fabs(_audioLoudness - _head.lastLoudness); _head.lastLoudness = _audioLoudness; diff --git a/interface/src/main.cpp b/interface/src/main.cpp index a20ad0e3a2..41ffdc1e92 100644 --- a/interface/src/main.cpp +++ b/interface/src/main.cpp @@ -482,10 +482,8 @@ void updateAvatar(float frametime) const float YAW_SENSITIVITY = 1.0; // If enabled, Update render pitch and yaw based on gyro data - if (::gyroLook) - { + if (::gyroLook) { if (fabs(gyroYawRate) > MIN_YAW_RATE) { - //if (fabs(myAvatar.getHeadYaw()) > MIN_YAW_ANGLE) { myAvatar.addBodyYaw(-gyroYawRate * YAW_SENSITIVITY * frametime); } }