// declared elsewhere in code.. just throwing this in to show what it is
IAnimatedMeshSceneNode* p;
vector3df pos = p->getPosition();
pos.X++;
p->setPosition(pos);
Thanks in advance!
Last edited by sephoroph on Sat Mar 26, 2011 5:57 pm, edited 1 time in total.
This is correct, the FPS counter is updated every 1,5 seconds, so it is by no means fit to be used in these kinds of calculations, the animator solution is a much better option
Returns current frames per second value.
This value is updated approximately every 1.5 seconds and is only intended to provide a rough guide to the average frame rate.. It is not suitable for use in performing timing calculations or framerate independent movement
But what did you mean with "using using an animator which passes the time in Ms"? Which animator? o0
Returns current frames per second value.
This value is updated approximately every 1.5 seconds and is only intended to provide a rough guide to the average frame rate.. It is not suitable for use in performing timing calculations or framerate independent movement
But what did you mean with "using using an animator which passes the time in Ms"? Which animator? o0
i mean
create your own animator and add it to a scene node.
once you define whatever behavior.. well here let me show you really quickly
//pseudo
class myAnimator : public ISceneNodeAnimator
{
custom_member_type* whatever;
f32 move_speed;
public:
//these methods are required to animated properly
animateNode(ISceneNode* node, u32 time_in_ms)
{
//do whatever you want to do to node position and/or rotation here
}
ISceneNodeAnimator* createClone(){return this*};
//you can also multi derive this from IEventReceiver, that is how fps cameras work.
};
myAnimator* anim;
IMeshSceneNode* node =IMeshSceneNode(mesh);
node->addAnimator(anim);
//now irrlicht will take care of animating that node in a timely manner.
ent1ty wrote:
success is a matter of concentration and desire
Butler Lampson wrote: all problems in Computer Science can be solved by another level of indirection