Adding a FPS Camera to a Model

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
Daystar
Posts: 58
Joined: Tue Jul 17, 2007 3:53 pm
Contact:

Adding a FPS Camera to a Model

Post by Daystar »

Hello all, I am trying to figure out how to attach a FPS camera to a model centered in its head, then I wanted to control the camera and the model with a event receiver instead of a KeyMap. Can anyone help me with this?
DayStar
lucifer1101
Posts: 42
Joined: Sun Nov 16, 2008 11:23 pm
Location: Melbourne, Australia
Contact:

Post by lucifer1101 »

well you will have to set up the model as the parent of the camera and then place the camera at the models head, i believe thats how its done...
Daystar
Posts: 58
Joined: Tue Jul 17, 2007 3:53 pm
Contact:

Post by Daystar »

But how do you do that?
DayStar
Ion Dune
Posts: 453
Joined: Mon Nov 12, 2007 8:29 pm
Location: California, USA
Contact:

Post by Ion Dune »

Actually, assuming you have a mesh and a camera with a collision response animator, it would be best to just attach the mesh to the camera though you will probably have to adjust the rotation manually. To do this is quite simple:

Code: Select all

character->setParent( camera ) ;
Then you'll have to figure out how to get the rotation right (I don't think it is updated for fps cameras, but you may be lucky).

However, none of this would work as well as if you used a real physics engine and a custom camera class - but I don't know if that's a possibility for you.
IrrNoob
Posts: 110
Joined: Sun Nov 16, 2008 8:01 pm
Location: Fort Collins, Us

Post by IrrNoob »

Post Reply