FPS camera using keys only

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
hungryninja
Posts: 26
Joined: Wed Jan 26, 2011 12:13 am

FPS camera using keys only

Post by hungryninja »

I am making a 3D editor for a game I'm making. I want to use an fps camera, but it uses the mouse, which I need for the editor. I want to use the numpad instead.
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Re: FPS camera using keys only

Post by Radikalizm »

hungryninja wrote:I am making a 3D editor for a game I'm making. I want to use an fps camera, but it uses the mouse, which I need for the editor. I want to use the numpad instead.
Take a look at the CSceneNodeAnimatorCameraFPS.cpp file, it contains the animator used for the FPS camera

You can then build your own animator with numpad controls based on the implementation in that file
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

make 2 cameras,

a fixed camera and a FPS camera;

switch from one to the other with Mouse_Right or a key;

here is an example where is used SPACE to commute between the 2 cameras; (edit mode and menu mode);

http://www.filefactory.com/file/ca16d77 ... latGUI.rar
Radikalizm
Posts: 1215
Joined: Tue Jan 09, 2007 7:03 pm
Location: Leuven, Belgium

Post by Radikalizm »

nespa wrote:make 2 cameras,

a fixed camera and a FPS camera;

switch from one to the other with Mouse_Right or a key;

here is an example where is used SPACE to commute between the 2 cameras; (edit mode and menu mode);

http://www.filefactory.com/file/ca16d77 ... latGUI.rar
Why would you want to use 2 cameras when you can easily achieve this with just 1 camera? From what I make up from it hungryninja just wants to rotate the camera with the numpad instead of the mouse

Irrlicht's scenenode system was designed to be easily manipulated by animators, why not use that system then?
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

having 2 cameras is a practice in many editor enviroments
Acki
Posts: 3496
Joined: Tue Jun 29, 2004 12:04 am
Location: Nobody's Place (Venlo NL)
Contact:

Post by Acki »

nespa wrote:make 2 cameras,

a fixed camera and a FPS camera;

switch from one to the other with Mouse_Right or a key;

here is an example where is used SPACE to commute between the 2 cameras; (edit mode and menu mode);

http://www.filefactory.com/file/ca16d77 ... latGUI.rar
nahh :shock:
if you want to go with switching by pressing space simply enable/disable the inputs for the fps camera !!! :lol:

Code: Select all

irr::scene::ICameraSceneNode::setInputReceiverEnabled( bool  enabled ) 
while(!asleep) sheep++;
IrrExtensions:Image
http://abusoft.g0dsoft.com
try Stendhal a MORPG written in Java
nespa
Posts: 167
Joined: Wed Feb 24, 2010 12:02 pm

Post by nespa »

right !

:)
Post Reply