Fps camera node

If you are a new Irrlicht Engine user, and have a newbie-question, this is the forum for you. You may also post general programming questions here.
Post Reply
NecromanX
Posts: 16
Joined: Sat Jan 24, 2004 6:01 pm

Fps camera node

Post 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?
niko
Site Admin
Posts: 1759
Joined: Fri Aug 22, 2003 4:44 am
Location: Vienna, Austria
Contact:

Post 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. :)
NecromanX
Posts: 16
Joined: Sat Jan 24, 2004 6:01 pm

Post 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
[dx/x]=HUNT3R
Posts: 271
Joined: Sat Aug 23, 2003 5:52 pm
Location: Hurricane Central, Florida

Post 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...
Post Reply