I am currently working on a visualization tool for some statistics, and I chose Irrlicht to handle it. I also decided to use Qt to move the camera precisely by entering the absolute coordinates for position and rotation.
Giving the absolute values for the position/rotation of the camera to a computer is great, but it is not very practical for humans
For this reason, I would like to be able to move a FPS camera precisely without using Irrlicht's keyboard-mouse input system and the game loop.
I saw there is a FPS camera in Irrlicht, but it seems to be inadequate for what I want, because I do not want to use keyboard input.
Do you know a way to get the movement vectors (forward, back, left, right) and the rotation vectors (actually angles pitch and yaw) ? Does Irrlicht provide this kind of "FPS-but-static" camera, or do I have do implement it by myself using maths ?
Here are the maths if you want them, by the way
aib from Stackoverflow wrote: The way I have always seen it done is using two angles, yaw and pitch. The two axes of mouse movement correspond to changes in these angles.
You can calculate the forward vector easily with a spherical-to-rectangular coordinate transformation. (pitch=latitude=φ, yaw=longitude=θ)
You can use a fixed up vector (say (0,0,1)) but this means you can't look directly upwards or downwards. (Most games solve this by allowing you to look no steeper than 89.999 degrees.)
The right vector is then the cross product of the forward and up vectors. It will always be parallel to the ground plane since the up vector is always perpendicular to the ground plane.
Left/right strafe keys then use the +/-right vector. For a forward vector parallel to the ground plane, you can take the cross product of the right and the up vectors.
As for the GL part, you can simply use gluLookAt() using the player's origin, the origin plus the forward vector and the up vector.
Oh and please, please add an "invert mouse" option.
Edit: Here's an alternative solution which gets rid of the 89.9 problem, asked in another question, which involves building the right vector first (with no pitch information) and then forward and up.