Frame End

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
Taymo
Posts: 55
Joined: Mon May 22, 2006 1:06 am
Location: Colorado Springs - CTU
Contact:

Frame End

Post by Taymo »

Whats the best way to check for the end of an animation cycle, without the animation callback. I thought I asked this before for Irrlicht and so I searched my post but couldn't find it. PHPBB's search is rubbish also.
Ride the Spiral Development:
spiralride.blogspot.com
Taymo
Posts: 55
Joined: Mon May 22, 2006 1:06 am
Location: Colorado Springs - CTU
Contact:

Post by Taymo »

Bump. Is this question too stupid to answer? There's gotta be something simple I'm missing..
Ride the Spiral Development:
spiralride.blogspot.com
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Re: Frame End

Post by Acki »

Taymo wrote:Whats the best way to check for the end of an animation cycle, without the animation callback.
I doubt there is a way...
maybe you can do something with IAnimatedMeshSceneNode::getFrameNr() ??? ;)
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

hi
i dont know whats is correct, but i do this way:
first, set the animation to not loop.
then you have two functions:
node->getFrameNr() -> gets the current frame
node->getEndFrame() -> gets the current animation loops last frame what you've set at node->setAnimationLoop
and just check if they're equal.
but remember it doesn't work if you set it to looping
Taymo
Posts: 55
Joined: Mon May 22, 2006 1:06 am
Location: Colorado Springs - CTU
Contact:

Re: Frame End

Post by Taymo »

Acki wrote:
Taymo wrote:Whats the best way to check for the end of an animation cycle, without the animation callback.
I doubt there is a way...
maybe you can do something with IAnimatedMeshSceneNode::getFrameNr() ??? ;)
That's the way I'm doing it now. I store animation cycles and check to see if the animation cycles end like B@z suggested, but I had set the loop mode to true, so I wasn't getting the numbers I need. This problem's solved. Thanks B@z and Acki.
Ride the Spiral Development:
spiralride.blogspot.com
B@z
Posts: 876
Joined: Thu Jan 31, 2008 5:05 pm
Location: Hungary

Post by B@z »

well, it doesn't work with loop mode, but...
you can do this

if (node->getFrameNr() == node->getEndFrame())
{
node->setFrameLoop(node->getStartFrame(), node->getEndFrame());
// and doing the thingy you need to do at the end of animation
}
Taymo
Posts: 55
Joined: Mon May 22, 2006 1:06 am
Location: Colorado Springs - CTU
Contact:

Post by Taymo »

B@z wrote:well, it doesn't work with loop mode, but...
you can do this

if (node->getFrameNr() == node->getEndFrame())
{
node->setFrameLoop(node->getStartFrame(), node->getEndFrame());
// and doing the thingy you need to do at the end of animation
}
Yep thanks. I bet an animation system with an editor would be a fun extension for Irrlicht to make. Hmmm..
Ride the Spiral Development:
spiralride.blogspot.com
Post Reply