alive::Status ActionTranslate::execute()
{
if (m_pNode == 0)
{
return FAILED;
}
// Setup a forward vector of sensible magnitude, and scale it according to
// the configuration of this action.
Ogre::Vector3 vTranslate(0.0f, 0.0f, 18.0f * m_Settings.getSpeed() * getDelta());
// Use Ogre to translate this scene graph node relatively to the current
// position.
m_pNode->translate(vTranslate, Ogre::Node::TS_LOCAL);
return RUNNING;
}
alive::Status ActionRotate::execute()
{
if (m_pNode == 0)
{
return FAILED;
}
// Setup a rotation quaternion according to the settings of this action.
Ogre::Quaternion qRotate;
qRotate.FromAngleAxis(getDelta() * Ogre::Radian(m_Settings.getSpeed()),
Ogre::Vector3::UNIT_Y);
// Use Ogre also to rotate this relatively to the Y axis.
m_pNode->rotate(qRotate, Ogre::Node::TS_LOCAL);
return RUNNING;
}