Limit FPS camera control?

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
Miik3h
Posts: 9
Joined: Mon Oct 17, 2005 1:08 am
Location: Australia

Limit FPS camera control?

Post by Miik3h »

Hi,

My FPS camera is travelling through my mesh that is setup with Newton's collision detection...

I have come to realize that this is most likely caused because even though I have attached my camera to a newton body and all that stuff, because I am still using Irrlicht camera controls to push my camera through the map it is not using newton forces and thus manages to travel through my mesh...? (anyone using newton please confirm that my thinking is correct here as I am still not 100% sure...) ?

Anyway, what I am after is to have a fps camera and just lose (or block) the keyboard controls (just rotation, with the mouse) or I would like to know how to add rotation control to a normal camera... addCameraSceneNode() ...

Thanks,
Miik3h :twisted:
pfo
Posts: 370
Joined: Mon Aug 29, 2005 10:54 pm
Location: http://web.utk.edu/~pfox1

Post by pfo »

You're right, you need to apply forces to your camera body in order to move it, via a force and torque callback in Newton. It would really be best to abandon the ICameraSceneNodeFPS and just use ICameraSceneNode with Newton transform and force and torque callbacks. As far as adding rotation, you would do that by applying torque. If you use Newton, you should never have to call node->setPosition, node->setRotation or node->setMatrix etc.... Newton handles this for you via the transform callback. In your app, what is happening is that the Newton Body is created for the camera, and just sits there. It will move when you apply force, and when it moves it will move the camera with it.
Guest

Post by Guest »

I said it twice in your Newton forum thread, I gladly repeat it here ;) : Search the Newton forum for "inverse dynamics". This will explain all about how to calculate the forces needed to move your camera body in the direction and with the speed you want.
You should only apply the rotation of your Newton body to the camera scene node if you keep tight control of the Newton bodies angular velocity (Omega in Newton terms). If you do so, you should consider applying an UpVectorJoint.
Look it all up in the Newton API docs, the Newton samples and the forum.

~Haffax
Post Reply