Animation Woes
Posted: Sun Jul 17, 2005 2:06 am
Alright, I've been searching about the forums and can't quite put together triggering an animation.
I have an *.X file loaded with an animation that I want to call when the camera is a certain disance away.
setting the difference from camera to node is no problem, but I can't seem to get the animation to kick in.
If I do:
...then the animation does not play at all, no matter the distance between camera and node.
If I remove the:
...then the animation plays continuously, nomatter what the distnces are.
Any clue?
Need any additional info to figure this out?
From searching the forums, I have also tried something like:
but alas, all to no avail.
I want to have the animation play one time when the distance is 100.0f(or whatever), but I can't even seem to get it to trigger in any way.
I've looked over the API docs for IAnimatedMeshX and such but...well, I don't entirely "get it."
please help...with a snippet if possible.
Thanks
I have an *.X file loaded with an animation that I want to call when the camera is a certain disance away.
setting the difference from camera to node is no problem, but I can't seem to get the animation to kick in.
If I do:
Code: Select all
core::vector3df cameraPosition = camera->getPosition();
f32 distance = cameraPosition.getDistanceFrom(node->getPosition());
while(device->run())
{
if (distance < 100.0f)
{
node->setFrameLoop(0, 50);
}
else
{
node->setFrameLoop(0, 0);
}
driver->beginScene(true, true, video::SColor(255,113,113,133));
smgr->drawAll();
driver->endScene();
}
device->drop();
return 0;
}
If I remove the:
Code: Select all
else
{
node->setFrameLoop(0, 0);
}
Any clue?
Need any additional info to figure this out?
From searching the forums, I have also tried something like:
Code: Select all
for (int i = 0; mesh->getFrameNr() < mesh->getFrameCount(); i++)
{
mesh->setCurrentFrame(i);
}
I want to have the animation play one time when the distance is 100.0f(or whatever), but I can't even seem to get it to trigger in any way.
I've looked over the API docs for IAnimatedMeshX and such but...well, I don't entirely "get it."
please help...with a snippet if possible.
Thanks