Create custom FPS Camera

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
MrSnowflake
Posts: 4
Joined: Sat Dec 22, 2007 5:42 pm

Create custom FPS Camera

Post by MrSnowflake »

Hi guys,

I need a FPS style camera for our school project. I tried implementing my own, but then I didn't get any mouse input. How can I get mouse and keyboard input to my camera?

And how to best implement jumping and crouching?
zeno60
Posts: 342
Joined: Sun May 21, 2006 2:48 am
Location: NC, USA
Contact:

Post by zeno60 »

Have you tried searching the forums? Also some of your own code would be good to share to better see where you are going wrong, I doubt many people are in the business of doing school homework for others.

Here are some search results to get you started:

For jumping:
http://irrlicht.sourceforge.net/phpBB2/ ... 0AND%20FPS

For your input problem you may want to check that you are setting up the eventreceiver correctly.

http://irrlicht.sourceforge.net/phpBB2/ ... ntreceiver
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

Try checking the source for the built-in FPS camera, that might help..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
MrSnowflake
Posts: 4
Joined: Sat Dec 22, 2007 5:42 pm

Post by MrSnowflake »

zeno60 wrote:Have you tried searching the forums? Also some of your own code would be good to share to better see where you are going wrong, I doubt many people are in the business of doing school homework for others.
I searched a lot, but most camera thread are about making rts style camera's.
LosNir
Posts: 43
Joined: Wed Dec 19, 2007 6:38 pm
Location: Israel
Contact:

Post by LosNir »

Use the built in FPS camera camera and use it with MastEventReceiver.
Solve the non responding camera inputs by this: http://irrlicht.sourceforge.net/phpBB2/ ... ntreceiver
MasterGod
Posts: 2061
Joined: Fri May 25, 2007 8:06 pm
Location: Israel
Contact:

Post by MasterGod »

I think he wants to create his own camera..
Image
Dev State: Abandoned (For now..)
Requirements Analysis Doc: ~87%
UML: ~0.5%
LosNir
Posts: 43
Joined: Wed Dec 19, 2007 6:38 pm
Location: Israel
Contact:

Post by LosNir »

I think he just had my problem, wanted to have built in FPS Cam actions but with external EventReceiver
MrSnowflake
Posts: 4
Joined: Sat Dec 22, 2007 5:42 pm

Post by MrSnowflake »

MasterGod wrote:I think he wants to create his own camera..
I do not _want_ to write my own camera. But I believe this is the best/only way to do this, as I'm integrating the Wii Remote and thus I need to be able to have control on how the camera reacts on mouse movement. And I want to be able to lean to a side, using the angel from the nunchuk.

Apparently the event receiver of the camera is working. But, as I copied the code from the addCameraSceneNodeFPS() from CSceneManager, the OnAnimate doesn't ge called. Maybe I should move all positioning stuff from this onAnimate() to my event handler. But I wanted to stay as close to the original camera.

[edit]I fixed by manually calling camera->OnAnimate(). So now I have my camera working.[/edit]
Post Reply