i'm using ogre 1.8 on the iphone xcode4
i'm trying to animate the camera from point A to point B.
for start all i want is to move the camera say from 0,0,100 to 0,0,150 within x seconds.
i looked at the forum and the sample and did the following:
Code: Select all
void OgreFramework::InitCameraAnimations()
{
mCamNode = m_pSceneMgr->getRootSceneNode()->createChildSceneNode("camera node");
mCamNode->attachObject(m_pCamera);
Ogre::Animation* mCamAnim = m_pSceneMgr->createAnimation( "Camera Animation", 10 );
mCamAnim ->setInterpolationMode( Ogre::Animation::IM_SPLINE );
// mCamAnim->setRotationInterpolationMode(Animation::RIM_SPHERICAL);
Ogre::NodeAnimationTrack* mCamTrack = mCamAnim->createNodeTrack( 0, mCamNode );
// mCamTrack->setUseShortestRotationPath( true );
Ogre::TransformKeyFrame* mCamKey;
mCamKey= mCamTrack->createNodeKeyFrame( 0 );
mCamKey->setTranslate( Ogre::Vector3(0, 0, 100) );
mCamKey= mCamTrack->createNodeKeyFrame( 10 );
mCamKey->setTranslate( Ogre::Vector3(0, 0, 150) );
//mCamKey->setRotation( Ogre::Quaternion(0.1,0.1,0.1,0.1) );
mCamAnimState = m_pSceneMgr->createAnimationState( "Camera Animation" );
}
Code: Select all
mCamAnimState ->setEnabled( true );
the effect im getting is that the animation is happening but immediately!
not during the 10 seconds i entered.
what could the problem be?
thanks alot !
