Page 1 of 1

Fps camera node

Posted: Tue Feb 17, 2004 2:44 pm
by NecromanX
I am updating the fps camera to make it feel more natural (the current fpscamera aint really an fps camera but a spectator camera)
but i have bumped into a problem. I just cant seem to find the piece of code that tells the camera to turn left when the cursor is moving horizontally.
I want to change the amount it moves because when you move 1 unit to the left you can see a it jump to the left to many units wich causes the camera to jitter when rotating

any advice?

Posted: Tue Feb 17, 2004 3:36 pm
by niko
The cursor is contantly placed into the center of the screen. If it is not in the center, the difference between cursor pos and screen center is calculated, and the camera moved by that difference. This is done in the animate() method. Hope it helped. :)

Posted: Fri Feb 20, 2004 4:30 pm
by NecromanX
yes i noticed the jittering happens because of the movespeed parameter.
the higher the more the camera jitters when you rotate :S

btw i noticed you now make the node move too when you rotate the camera :p

Posted: Fri Feb 20, 2004 9:22 pm
by [dx/x]=HUNT3R
I think what you're looking for is this?... If you just go into the animate function that Niko mentioned and find this code:

Code: Select all

if (cursorpos.X < 0.49f || cursorpos.X > 0.51f ||
			cursorpos.Y < 0.49f || cursorpos.Y > 0.51f){
You can make it much more precise and less "jumpy" by changing the precision to 0.4999 and 0.5001. Thats what I use and it is butter smooth...