I want an IAnimatedMeshSceneNode to follow a curved path, so thought of using the CreateFollowSplineAnimator function. The node always faces the same direction though - is there any way to override the direction to get it to face the direction of motion?
Secondly, the default for the spline is to repeat the animation, with flystraight there is a bool loop parameter - is this possible with the spline?
(Failing this I presume I have to crea tthe spline myself with the direction of movement and update the node with the path.)
Thanks
CreateFollowSplineAnimator and IAnimatedMeshSceneNode rotn
-
- Posts: 6
- Joined: Fri Oct 27, 2006 9:39 pm
Here's a quick-and-dirty work-around:niko wrote:No, currently the animator is not able to make the camera look into a direction or play it not looped. But you're invited to add this functionality if you like
Code: Select all
static core::vector3df previous_position = core::vector3df(0,0,0);
//... later, in the main loop
scene::ICameraSceneNode* sscam = sceneManager->getActiveCamera();
sscam->setTarget(sscam->getPosition() - previous_position + sscam->getPosition());
previous_position = sscam->getPosition();