Mouse controls FPS camera - custom

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
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Mouse controls FPS camera - custom

Post by Ion Dune »

I'm building a player-based FPS character for a game I'm making, with a camera attached to the head. I've got rotation, target, and all that fancy stuff working fine. My only problem now is mouse control: I've got it working to the extent that you can use the mouse to turn around and everything, but it's got a bad feel that I want to work out. For example, it seems sluggish to move at first, and if you move the mouse too much its very easy to overcompensate.

I control looking by changing the target every iteration based on the mouse's distance from center, and then reset the mouse location to center. I thought this would be the right way to do it, but if feels really poorly done.

I wanted to see how it was done for the FPS camera, but I can't seem to find the source for it's movement in the API. Could anyone tell me where I might find that source?

Also, if anyone has ever done this before, could they give me some hints on how to work mouse movement?

Thanks for your time.
ultran00b
Posts: 35
Joined: Tue Oct 30, 2007 3:30 pm

Post by ultran00b »

The source code for the FPS camera can be found in the 'source' directory, in CCameraFPSSceneNode.h and .cpp.
Use the debugger, young Skywalker...
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Hah! Thanks, I had been looking at the .h only for some reason, and couldn't garner much from that.
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

Image

Image, meet Adblock. Adblock, SMASH IMAGE! ADBLOCK SMASH!
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
ultran00b
Posts: 35
Joined: Tue Oct 30, 2007 3:30 pm

Post by ultran00b »

Rogerborg: At least it's not as big as JP's...
Use the debugger, young Skywalker...
FlyingIsFun1217
Posts: 219
Joined: Fri Apr 13, 2007 8:29 pm
Location: Illinois
Contact:

Post by FlyingIsFun1217 »

Doesn't mean it's small... :/

Good pic, just... scale it... :)

FlyingIsFun1217
rogerborg
Admin
Posts: 3590
Joined: Mon Oct 09, 2006 9:36 am
Location: Scotland - gonnae no slag aff mah Engleesh
Contact:

Post by rogerborg »

ultran00b wrote:Rogerborg: At least it's not as big as JP's...
That was SMASHED a long time ago. ;)
Please upload candidate patches to the tracker.
Need help now? IRC to #irrlicht on irc.freenode.net
How To Ask Questions The Smart Way
Post Reply