Page 1 of 1

Mouse controls FPS camera - custom

Posted: Sat Dec 01, 2007 4:29 am
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.

Posted: Sat Dec 01, 2007 4:55 am
by ultran00b
The source code for the FPS camera can be found in the 'source' directory, in CCameraFPSSceneNode.h and .cpp.

Posted: Sat Dec 01, 2007 5:02 am
by Ion Dune
Hah! Thanks, I had been looking at the .h only for some reason, and couldn't garner much from that.

Posted: Sat Dec 01, 2007 10:44 am
by rogerborg
Image

Image, meet Adblock. Adblock, SMASH IMAGE! ADBLOCK SMASH!

Posted: Sat Dec 01, 2007 3:12 pm
by ultran00b
Rogerborg: At least it's not as big as JP's...

Posted: Sat Dec 01, 2007 4:25 pm
by FlyingIsFun1217
Doesn't mean it's small... :/

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

FlyingIsFun1217

Posted: Sat Dec 01, 2007 5:48 pm
by rogerborg
ultran00b wrote:Rogerborg: At least it's not as big as JP's...
That was SMASHED a long time ago. ;)