Camera look at oddity
Posted: Fri Jul 06, 2007 7:55 pm
I noticed something odd with camera->getTarget()
I use the following 2 lines of code to get the start point of a bullet fired from the player and the trajectory.
vector3df aimVector=(camera->getTarget() - camera->getPosition()).normalize();
vector3df aimStart=camera->getPosition();
This works fine most of the time. However if you are moving I noticed that the values get negative signs. Now movement is something I am controlling myself. I use a fpscamera but I have disabled the movement keys and only retain the mouselook(by using the constructor keymapping)
My question is, if I am programatically moving the camera in response to my physics engine events, why would moving in any way effect these lines of code? The graphical view looks fine when moving, I don't flicker to looking backwards(which is what would happen since my bullets are comming out my back).
Is there a multithreading issue with these events from irrlicht, or are they comming in on the main thread still?
Is using an FPS camera bad? I just want the mouselook capability so I could implement it myself if I have to.
I use the following 2 lines of code to get the start point of a bullet fired from the player and the trajectory.
vector3df aimVector=(camera->getTarget() - camera->getPosition()).normalize();
vector3df aimStart=camera->getPosition();
This works fine most of the time. However if you are moving I noticed that the values get negative signs. Now movement is something I am controlling myself. I use a fpscamera but I have disabled the movement keys and only retain the mouselook(by using the constructor keymapping)
My question is, if I am programatically moving the camera in response to my physics engine events, why would moving in any way effect these lines of code? The graphical view looks fine when moving, I don't flicker to looking backwards(which is what would happen since my bullets are comming out my back).
Is there a multithreading issue with these events from irrlicht, or are they comming in on the main thread still?
Is using an FPS camera bad? I just want the mouselook capability so I could implement it myself if I have to.