Rotation animator with deceleration over time

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
andrew
Posts: 7
Joined: Thu Oct 07, 2010 6:51 pm

Rotation animator with deceleration over time

Post by andrew »

I am fairly inexperienced with Irrlicht and am trying to figure out how to create a rotation animator that decelerates over time. From looking around I need to make my own animator or set up a physics engine. I'm looking for a simple solution here so I think the physics engine approach might be a bit much.

For a custom animator I would have something like

Code: Select all

createRotationAnimator(vector3df(0, 1, 0), 1.0);
which behaves as normal but decelerates to 0 over the course of 1 second.

I was wondering if I am approaching this the right way or if perhaps I am missing something and I can achieve this functionality some other way.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

Yes, a custom animator would be the easiest way to do this
andrew
Posts: 7
Joined: Thu Oct 07, 2010 6:51 pm

Post by andrew »

Radikalizm wrote:Yes, a custom animator would be the easiest way to do this
Thanks, I'll look into this. Do you know of any resources that would help with this?
Xaryl
Posts: 90
Joined: Sat Apr 30, 2011 11:54 pm

Post by Xaryl »

You can look at the source code of an inbuilt animator.
Try a simple one, maybe CSceneNodeAnimatorFlyCircle
and don't worry about serializeAttributes and deserializeAttributes for your very first animator.

Basically, the animateNode(ISceneNode* node, u32 timeMs) is called every time smgr->drawAll() is called,
so just do what you need with the node in that function.
andrew
Posts: 7
Joined: Thu Oct 07, 2010 6:51 pm

Post by andrew »

Time to go fishing in the source code then. Thanks for the info!
Post Reply