From 4b31d87bf5b11c312d6d4f53db18bfd305487895 Mon Sep 17 00:00:00 2001 From: "Anthony J. Thibault" Date: Sun, 27 Sep 2015 17:52:53 -0700 Subject: [PATCH] renamed magic constant to FRAMES_PER_SECOND. --- libraries/animation/src/Rig.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libraries/animation/src/Rig.cpp b/libraries/animation/src/Rig.cpp index 491a390025..a0cb278ef3 100644 --- a/libraries/animation/src/Rig.cpp +++ b/libraries/animation/src/Rig.cpp @@ -147,17 +147,18 @@ AnimationHandlePointer Rig::addAnimationByRole(const QString& role, const QStrin } const float FADE_FRAMES = 30.0f; +const float FRAMES_PER_SECOND = 30.0f; void Rig::startAnimationByRole(const QString& role, const QString& url, float fps, float priority, bool loop, bool hold, float firstFrame, float lastFrame, const QStringList& maskedJoints) { AnimationHandlePointer handle = addAnimationByRole(role, url, fps, priority, loop, hold, firstFrame, lastFrame, maskedJoints, true); - handle->setFadePerSecond(30.0f / FADE_FRAMES); // For now. Could be individualized later. + handle->setFadePerSecond(FRAMES_PER_SECOND / FADE_FRAMES); // For now. Could be individualized later. } void Rig::stopAnimationByRole(const QString& role) { foreach (const AnimationHandlePointer& handle, getRunningAnimations()) { if (handle->getRole() == role) { - handle->setFadePerSecond(-(30.0f / FADE_FRAMES)); // For now. Could be individualized later. + handle->setFadePerSecond(-(FRAMES_PER_SECOND / FADE_FRAMES)); // For now. Could be individualized later. } } } @@ -166,7 +167,7 @@ void Rig::stopAnimation(const QString& url) { foreach (const AnimationHandlePointer& handle, getRunningAnimations()) { if (handle->getURL() == url) { handle->setFade(0.0f); // right away. Will be remove during updateAnimations, without locking - handle->setFadePerSecond(-(30.0f / FADE_FRAMES)); // so that the updateAnimation code notices + handle->setFadePerSecond(-(FRAMES_PER_SECOND / FADE_FRAMES)); // so that the updateAnimation code notices } } }