From a0ecd167fce716adc39d5a997fb4060eda5b1d18 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 24 Jun 2013 10:31:11 -0700 Subject: [PATCH] Replace 0/1 with FULLY_OPEN/CLOSED. --- interface/src/Head.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/interface/src/Head.cpp b/interface/src/Head.cpp index e2e5efcb9a..61b4ca96b9 100644 --- a/interface/src/Head.cpp +++ b/interface/src/Head.cpp @@ -169,6 +169,8 @@ void Head::simulate(float deltaTime, bool isMine) { // update eyelid blinking const float BLINK_SPEED = 5.0f; + const float FULLY_OPEN = 0.0f; + const float FULLY_CLOSED = 1.0f; if (_leftEyeBlinkVelocity == 0.0f && _rightEyeBlinkVelocity == 0.0f) { const float BLINK_INTERVAL = 4.0f; if (shouldDo(BLINK_INTERVAL, deltaTime)) { @@ -176,19 +178,19 @@ void Head::simulate(float deltaTime, bool isMine) { _rightEyeBlinkVelocity = BLINK_SPEED; } } else { - _leftEyeBlink = glm::clamp(_leftEyeBlink + _leftEyeBlinkVelocity * deltaTime, 0.0f, 1.0f); - _rightEyeBlink = glm::clamp(_rightEyeBlink + _rightEyeBlinkVelocity * deltaTime, 0.0f, 1.0f); + _leftEyeBlink = glm::clamp(_leftEyeBlink + _leftEyeBlinkVelocity * deltaTime, FULLY_OPEN, FULLY_CLOSED); + _rightEyeBlink = glm::clamp(_rightEyeBlink + _rightEyeBlinkVelocity * deltaTime, FULLY_OPEN, FULLY_CLOSED); - if (_leftEyeBlink == 1.0f) { + if (_leftEyeBlink == FULLY_CLOSED) { _leftEyeBlinkVelocity = -BLINK_SPEED; - } else if (_leftEyeBlink == 0.0f) { + } else if (_leftEyeBlink == FULLY_OPEN) { _leftEyeBlinkVelocity = 0.0f; } - if (_rightEyeBlink == 1.0f) { + if (_rightEyeBlink == FULLY_CLOSED) { _rightEyeBlinkVelocity = -BLINK_SPEED; - } else if (_rightEyeBlink == 0.0f) { + } else if (_rightEyeBlink == FULLY_OPEN) { _rightEyeBlinkVelocity = 0.0f; } }