mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 04:44:11 +02:00
renamed magic constant to FRAMES_PER_SECOND.
This commit is contained in:
parent
5a24a020ca
commit
4b31d87bf5
1 changed files with 4 additions and 3 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue