I'm new to Irrlicht, but not to C++. I have checked the tutorials sections (and used google) and cannot find anything to satisfied my needs.
I've been having some issues with my 3rd person camera. I'm working on a short 3rd person action project, but cannot seem to get my mouse handling to work properly. Maybe I'm missing the logic?
Basically, the camera constantly updates based on the position of the player node if no mouse is clicked. However, if the mouse is right-clicked, I'd like to allow a free rotate within a defined radius in real-time.
I am handling most events through an external function which is updated by boolean key clicks. However, I feel this might not be efficient (or possible) to allow real-time camera rotating with the mouse, so I have this part set directly in my event handler (the standard OnEvent derived from IEventReceiver). Perhaps there is a better way to do this?
I have code similar to this in my event handler
Code: Select all
if(MouseKeys[2] == true)
{
scene::ICameraSceneNode* cam = device->getSceneManager()->getActiveCamera();
if(event.MouseInput.Event == EMIE_MOUSE_MOVED)
{
cam->setTarget(core::vector3df((f32)event.MouseInput.X,(f32)-event.MouseInput.Y,(f32)event.MouseInput.X*10));
}
}
Any ideas?
Thanks!
-RageD