mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:24:07 +02:00
Use 15 blinks per minute as a base/maximum frequency.
This commit is contained in:
parent
b7e9173796
commit
43258f9dcd
1 changed files with 5 additions and 4 deletions
|
@ -189,12 +189,13 @@ void Head::simulate(float deltaTime, bool isMine) {
|
|||
const float FULLY_CLOSED = 1.0f;
|
||||
if (_leftEyeBlinkVelocity == 0.0f && _rightEyeBlinkVelocity == 0.0f) {
|
||||
// no blinking when brows are raised; blink less with increasing loudness
|
||||
const float ROOT_LOUDNESS_TO_BLINK_INTERVAL = 0.75f;
|
||||
if (forceBlink || (_browAudioLift < EPSILON && shouldDo(
|
||||
sqrtf(_averageLoudness) * ROOT_LOUDNESS_TO_BLINK_INTERVAL, deltaTime))) {
|
||||
const float BASE_BLINK_RATE = 15.0f / 60.0f;
|
||||
const float ROOT_LOUDNESS_TO_BLINK_INTERVAL = 0.25f;
|
||||
if (forceBlink || (_browAudioLift < EPSILON && shouldDo(glm::max(1.0f, sqrt(_averageLoudness) *
|
||||
ROOT_LOUDNESS_TO_BLINK_INTERVAL) / BASE_BLINK_RATE, deltaTime))) {
|
||||
_leftEyeBlinkVelocity = BLINK_SPEED;
|
||||
_rightEyeBlinkVelocity = BLINK_SPEED;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
_leftEyeBlink = glm::clamp(_leftEyeBlink + _leftEyeBlinkVelocity * deltaTime, FULLY_OPEN, FULLY_CLOSED);
|
||||
_rightEyeBlink = glm::clamp(_rightEyeBlink + _rightEyeBlinkVelocity * deltaTime, FULLY_OPEN, FULLY_CLOSED);
|
||||
|
|
Loading…
Reference in a new issue