renamed magic constant to FRAMES_PER_SECOND.

This commit is contained in:
Anthony J. Thibault 2015-09-27 17:52:53 -07:00
parent 5a24a020ca
commit 4b31d87bf5

View file

@ -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
}
}
}