mirror of
https://github.com/AquariaOSE/Aquaria.git
synced 2025-01-24 17:26:41 +00:00
fix animations possibly going nuts in the anim editor due to timer overflow handling
This commit is contained in:
parent
dd403d7d55
commit
6bffa3a3f9
1 changed files with 7 additions and 2 deletions
|
@ -2005,7 +2005,14 @@ void AnimationLayer::updateBones()
|
||||||
|
|
||||||
unsigned nextidx = curidx + 1;
|
unsigned nextidx = curidx + 1;
|
||||||
if(nextidx > maxidx)
|
if(nextidx > maxidx)
|
||||||
|
{
|
||||||
|
if(key1->t < timer) // past the last keyframe? just stay there (unless the timer wraps too)
|
||||||
|
{
|
||||||
|
key2 = key1;
|
||||||
|
break;
|
||||||
|
}
|
||||||
nextidx = 0;
|
nextidx = 0;
|
||||||
|
}
|
||||||
key2 = &a->keyframes[nextidx];
|
key2 = &a->keyframes[nextidx];
|
||||||
|
|
||||||
if((key1->t <= timer && timer <= key2->t) || !maxidx)
|
if((key1->t <= timer && timer <= key2->t) || !maxidx)
|
||||||
|
@ -2021,8 +2028,6 @@ void AnimationLayer::updateBones()
|
||||||
const float t2 = key2->t;
|
const float t2 = key2->t;
|
||||||
assert(t1 <= t2);
|
assert(t1 <= t2);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
const float diff = t2-t1;
|
const float diff = t2-t1;
|
||||||
float dt;
|
float dt;
|
||||||
if (diff != 0)
|
if (diff != 0)
|
||||||
|
|
Loading…
Reference in a new issue