Aniketos
Member
|
How do you stop a motion?
How do I end a Motion animation? I tried general_motion.clear(); but it doesn't do anything...
I'm doing something like this code wise:
struct GeneralAnimation : Motion
{
void set(CSkeleton &cskel, Str animation);
};
GeneralAnimation general_motion;
general_motion.set(cskel,"anim/custom/idle.anim");
|
|
12-19-2010 05:39 AM |
|
Driklyn
Member
|
RE: How do you stop a motion?
The way I did it in my game demo was a combination of calling .clear() and a stoppage of calling .updateAuto(). So something like this:
Code:
void Player::animate()
{
...
if (updateAnimation) general_motion.updateAuto(3, 3, Time.speed());
...
}
...
general_motion.clear();
updateAnimation = false;
You could also try setting the time to the end of the animation:
Code:
general_motion.time = general_motion.skel_anim->length();
(This post was last modified: 12-19-2010 11:32 PM by Driklyn.)
|
|
12-19-2010 11:27 PM |
|