mirror of
https://github.com/lubosz/overte.git
synced 2025-04-16 01:13:40 +02:00
Prevent audio average from becoming less than zero (thus causing sqrt to
return nan, thus making our fake blendshape coefficient nan, thus making the jaw disappear). Closes #2334.
This commit is contained in:
parent
2673aa00f0
commit
d80f110961
1 changed files with 1 additions and 2 deletions
|
@ -90,8 +90,7 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) {
|
|||
_saccade += (_saccadeTarget - _saccade) * 0.50f;
|
||||
|
||||
const float AUDIO_AVERAGING_SECS = 0.05f;
|
||||
_averageLoudness = (1.f - deltaTime / AUDIO_AVERAGING_SECS) * _averageLoudness +
|
||||
(deltaTime / AUDIO_AVERAGING_SECS) * _audioLoudness;
|
||||
_averageLoudness = glm::mix(_averageLoudness, _audioLoudness, glm::min(deltaTime / AUDIO_AVERAGING_SECS, 1.0f));
|
||||
|
||||
// Detect transition from talking to not; force blink after that and a delay
|
||||
bool forceBlink = false;
|
||||
|
|
Loading…
Reference in a new issue