mirror of
https://github.com/lubosz/overte.git
synced 2025-08-07 16:41:02 +02:00
set the phase to 0.0 when it is negative
This commit is contained in:
parent
b8e93ec688
commit
220dbf586f
1 changed files with 4 additions and 0 deletions
|
@ -155,6 +155,7 @@ void AnimBlendLinearMove::setFrameAndPhase(float dt, float alpha, int prevPoseIn
|
||||||
|
|
||||||
// integrate phase forward in time.
|
// integrate phase forward in time.
|
||||||
_phase += omega * dt;
|
_phase += omega * dt;
|
||||||
|
qCDebug(animation) << "the _phase is " << _phase;
|
||||||
|
|
||||||
// detect loop trigger events
|
// detect loop trigger events
|
||||||
if (_phase >= 1.0f) {
|
if (_phase >= 1.0f) {
|
||||||
|
@ -172,4 +173,7 @@ void AnimBlendLinearMove::setCurrentFrameInternal(float frame) {
|
||||||
assert(clipNode);
|
assert(clipNode);
|
||||||
const float NUM_FRAMES = (clipNode->getEndFrame() - clipNode->getStartFrame()) + 1.0f;
|
const float NUM_FRAMES = (clipNode->getEndFrame() - clipNode->getStartFrame()) + 1.0f;
|
||||||
_phase = fmodf(frame / NUM_FRAMES, 1.0f);
|
_phase = fmodf(frame / NUM_FRAMES, 1.0f);
|
||||||
|
if (_phase < 0.0f) {
|
||||||
|
_phase = 0.0f; // 1.0f + _phase;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue