mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 10:43:45 +02:00
Reinstate missing guards
This commit is contained in:
parent
0d6513c7dc
commit
597312ff45
1 changed files with 24 additions and 20 deletions
|
@ -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));
|
||||||
}
|
}
|
||||||
|
|
||||||
float audioAttackAveragingRate = (10.0f - deltaTime * NORMAL_HZ) / 10.0f; // --> 0.9 at 60 Hz
|
if (!_isFaceTrackerConnected) {
|
||||||
_audioAttack = audioAttackAveragingRate * _audioAttack +
|
float audioAttackAveragingRate = (10.0f - deltaTime * NORMAL_HZ) / 10.0f; // --> 0.9 at 60 Hz
|
||||||
(1.0f - audioAttackAveragingRate) * fabs((audioLoudness - _longTermAverageLoudness) - _lastLoudness);
|
_audioAttack = audioAttackAveragingRate * _audioAttack +
|
||||||
_lastLoudness = (audioLoudness - _longTermAverageLoudness);
|
(1.0f - audioAttackAveragingRate) * fabs((audioLoudness - _longTermAverageLoudness) - _lastLoudness);
|
||||||
|
_lastLoudness = (audioLoudness - _longTermAverageLoudness);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::computeEyeMovement(float deltaTime) {
|
void Head::computeEyeMovement(float deltaTime) {
|
||||||
|
@ -139,23 +141,25 @@ void Head::computeEyeMovement(float deltaTime) {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::computeFaceMovement(float deltaTime) {
|
void Head::computeFaceMovement(float deltaTime) {
|
||||||
// Update audio attack data for facial animation (eyebrows and mouth)
|
if (!_isFaceTrackerConnected) {
|
||||||
const float BROW_LIFT_THRESHOLD = 100.0f;
|
// Update audio attack data for facial animation (eyebrows and mouth)
|
||||||
if (_audioAttack > BROW_LIFT_THRESHOLD) {
|
const float BROW_LIFT_THRESHOLD = 100.0f;
|
||||||
_browAudioLift += sqrtf(_audioAttack) * 0.01f;
|
if (_audioAttack > BROW_LIFT_THRESHOLD) {
|
||||||
}
|
_browAudioLift += sqrtf(_audioAttack) * 0.01f;
|
||||||
_browAudioLift = glm::clamp(_browAudioLift *= 0.7f, 0.0f, 1.0f);
|
}
|
||||||
|
_browAudioLift = glm::clamp(_browAudioLift *= 0.7f, 0.0f, 1.0f);
|
||||||
|
|
||||||
// use data to update fake Faceshift blendshape coefficients
|
// use data to update fake Faceshift blendshape coefficients
|
||||||
calculateMouthShapes(deltaTime);
|
calculateMouthShapes(deltaTime);
|
||||||
FaceTracker::updateFakeCoefficients(_leftEyeBlink,
|
FaceTracker::updateFakeCoefficients(_leftEyeBlink,
|
||||||
_rightEyeBlink,
|
_rightEyeBlink,
|
||||||
_browAudioLift,
|
_browAudioLift,
|
||||||
_audioJawOpen,
|
_audioJawOpen,
|
||||||
_mouth2,
|
_mouth2,
|
||||||
_mouth3,
|
_mouth3,
|
||||||
_mouth4,
|
_mouth4,
|
||||||
_transientBlendshapeCoefficients);
|
_transientBlendshapeCoefficients);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::computeEyePosition() {
|
void Head::computeEyePosition() {
|
||||||
|
|
Loading…
Reference in a new issue