Better scene::CSceneNodeAnimatorRotation

You discovered a bug in the engine, and you are sure that it is not a problem of your code? Just post it in here. Please read the bug posting guidelines first.
Post Reply
warui
Posts: 232
Joined: Wed Apr 14, 2004 12:06 pm
Location: Lodz, Poland
Contact:

Better scene::CSceneNodeAnimatorRotation

Post by warui »

The problem with rotation animator is that it always resets rotation of a model to [0,0,0]. To fix it just change original
void CSceneNodeAnimatorRotation::animateNode(ISceneNode* node, u32 timeMs) from CSceneNodeAnimatorRotation.cpp to this one:

Code: Select all

void CSceneNodeAnimatorRotation::animateNode(ISceneNode* node, u32 timeMs)
{
  if (node)
  {
    core::vector3df NewRotation = node->getRotation();
    NewRotation += Rotation* ((timeMs-StartTime)/10.0f);
    node->setRotation(NewRotation);
    StartTime=timeMs;
  }
}
Now i work on new rotation animator similar to fly straight one (you can state goal rotation or make it rotating endlessly). If you need some additional funcionality just tell me.
Tomasz Nowakowski
Openoko - www.openoko.pl
Post Reply