Reinstate missing guards

This commit is contained in:
David Rowe 2017-05-20 12:08:01 +12:00
parent 0d6513c7dc
commit 597312ff45

View file

@ -58,10 +58,12 @@ void Head::computeAudioLoudness(float deltaTime) {
_longTermAverageLoudness = glm::mix(_longTermAverageLoudness, _averageLoudness, glm::min(deltaTime / AUDIO_LONG_TERM_AVERAGING_SECS, 1.0f)); _longTermAverageLoudness = glm::mix(_longTermAverageLoudness, _averageLoudness, glm::min(deltaTime / AUDIO_LONG_TERM_AVERAGING_SECS, 1.0f));
} }
if (!_isFaceTrackerConnected) {
float audioAttackAveragingRate = (10.0f - deltaTime * NORMAL_HZ) / 10.0f; // --> 0.9 at 60 Hz float audioAttackAveragingRate = (10.0f - deltaTime * NORMAL_HZ) / 10.0f; // --> 0.9 at 60 Hz
_audioAttack = audioAttackAveragingRate * _audioAttack + _audioAttack = audioAttackAveragingRate * _audioAttack +
(1.0f - audioAttackAveragingRate) * fabs((audioLoudness - _longTermAverageLoudness) - _lastLoudness); (1.0f - audioAttackAveragingRate) * fabs((audioLoudness - _longTermAverageLoudness) - _lastLoudness);
_lastLoudness = (audioLoudness - _longTermAverageLoudness); _lastLoudness = (audioLoudness - _longTermAverageLoudness);
}
} }
void Head::computeEyeMovement(float deltaTime) { void Head::computeEyeMovement(float deltaTime) {
@ -139,6 +141,7 @@ void Head::computeEyeMovement(float deltaTime) {
} }
void Head::computeFaceMovement(float deltaTime) { void Head::computeFaceMovement(float deltaTime) {
if (!_isFaceTrackerConnected) {
// Update audio attack data for facial animation (eyebrows and mouth) // Update audio attack data for facial animation (eyebrows and mouth)
const float BROW_LIFT_THRESHOLD = 100.0f; const float BROW_LIFT_THRESHOLD = 100.0f;
if (_audioAttack > BROW_LIFT_THRESHOLD) { if (_audioAttack > BROW_LIFT_THRESHOLD) {
@ -156,6 +159,7 @@ void Head::computeFaceMovement(float deltaTime) {
_mouth3, _mouth3,
_mouth4, _mouth4,
_transientBlendshapeCoefficients); _transientBlendshapeCoefficients);
}
} }
void Head::computeEyePosition() { void Head::computeEyePosition() {