Kim2
24-10-2008 23:20:11
I'm having a huge jittering problem with my game, the moment the FPS deviates by ten or so from the desired_frame_rate value the camera goes spastic and shakes around. I've read all the threads about this I can find and it seems that the solution as explained by Walaber is to update the camera inside the newton update loop but even after looking at the stunt playground source I don't understand how to do this.
The key seems to be the deltat value being sent to the followcamera update function... can somebody please explain how this all fits together so that the camera doesn't jitter?
Just looking at this code... how does Ogre know to render the scene with the followCamera and not the other one (cam)?
I'm just passing a single camera to a framelistener in which I execute all game logic and the newton world update, is there a way to update the camera inside the framelistener so I get the same smooth tracking as in Stunt Playground without needing a custom camera class?
I really appreciate any help, this is very frustrating!
The key seems to be the deltat value being sent to the followcamera update function... can somebody please explain how this all fits together so that the camera doesn't jitter?
MainFrameListener::MainFrameListener(RenderWindow* win, Camera* cam, SceneManager* mgr, FollowCamera* follow, OgreNewt::World* world, int desired_fps ) :
WalaberOgreFrameListener(win)Just looking at this code... how does Ogre know to render the scene with the followCamera and not the other one (cam)?
I'm just passing a single camera to a framelistener in which I execute all game logic and the newton world update, is there a way to update the camera inside the framelistener so I get the same smooth tracking as in Stunt Playground without needing a custom camera class?
mNewtonListener = new OgreNewt::ProjectNewtonFrameListener( mWindow, mCamera, mSceneMgr, mRoot, msnCam, m_World, 60);
mRoot->addFrameListener(mNewtonListener);I really appreciate any help, this is very frustrating!