mirror of
https://github.com/overte-org/overte.git
synced 2025-08-08 13:18:38 +02:00
Merge pull request #4708 from ctrlaltdavid/fix-audio-mouth
Fix audio-driven mouth viewed by others
This commit is contained in:
commit
e646ff6847
1 changed files with 11 additions and 11 deletions
|
@ -73,20 +73,20 @@ void Head::reset() {
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::simulate(float deltaTime, bool isMine, bool billboard) {
|
void Head::simulate(float deltaTime, bool isMine, bool billboard) {
|
||||||
|
// Update audio trailing average for rendering facial animations
|
||||||
|
const float AUDIO_AVERAGING_SECS = 0.05f;
|
||||||
|
const float AUDIO_LONG_TERM_AVERAGING_SECS = 30.0f;
|
||||||
|
_averageLoudness = glm::mix(_averageLoudness, _audioLoudness, glm::min(deltaTime / AUDIO_AVERAGING_SECS, 1.0f));
|
||||||
|
|
||||||
|
if (_longTermAverageLoudness == -1.0) {
|
||||||
|
_longTermAverageLoudness = _averageLoudness;
|
||||||
|
} else {
|
||||||
|
_longTermAverageLoudness = glm::mix(_longTermAverageLoudness, _averageLoudness, glm::min(deltaTime / AUDIO_LONG_TERM_AVERAGING_SECS, 1.0f));
|
||||||
|
}
|
||||||
|
|
||||||
if (isMine) {
|
if (isMine) {
|
||||||
MyAvatar* myAvatar = static_cast<MyAvatar*>(_owningAvatar);
|
MyAvatar* myAvatar = static_cast<MyAvatar*>(_owningAvatar);
|
||||||
|
|
||||||
// Update audio trailing average for rendering facial animations
|
|
||||||
const float AUDIO_AVERAGING_SECS = 0.05f;
|
|
||||||
const float AUDIO_LONG_TERM_AVERAGING_SECS = 30.0f;
|
|
||||||
_averageLoudness = glm::mix(_averageLoudness, _audioLoudness, glm::min(deltaTime / AUDIO_AVERAGING_SECS, 1.0f));
|
|
||||||
|
|
||||||
if (_longTermAverageLoudness == -1.0) {
|
|
||||||
_longTermAverageLoudness = _averageLoudness;
|
|
||||||
} else {
|
|
||||||
_longTermAverageLoudness = glm::mix(_longTermAverageLoudness, _averageLoudness, glm::min(deltaTime / AUDIO_LONG_TERM_AVERAGING_SECS, 1.0f));
|
|
||||||
}
|
|
||||||
|
|
||||||
// Only use face trackers when not playing back a recording.
|
// Only use face trackers when not playing back a recording.
|
||||||
if (!myAvatar->isPlaying()) {
|
if (!myAvatar->isPlaying()) {
|
||||||
FaceTracker* faceTracker = Application::getInstance()->getActiveFaceTracker();
|
FaceTracker* faceTracker = Application::getInstance()->getActiveFaceTracker();
|
||||||
|
|
Loading…
Reference in a new issue