Page 1 of 1

FPS Camera only when mouse is clicked?

Posted: Sat Nov 01, 2008 5:47 pm
by Atz666
How could I posibily do that?
I want to look around with the mouse only when it's clicked and when not to be able to freely use the mouse to click objects.
I took a look at the functions inside the ICameraSceneNode and coudn't find what I'm looking for.
Thank you!

Posted: Sat Nov 01, 2008 7:00 pm
by XXChester
When you click the mouse just create a FPS camera and make it the active camera, I think that will work.

Posted: Sat Nov 01, 2008 7:29 pm
by vitek
Yes, you could switch the active camera. If you do that you'll likely want to copy many of the camera attributes when you switch between cameras (camera target, position, fov, ...).

Another way would be to use camera->setInputReceiverEnabled(). You would set it to false initially, and then when the appropriate mouse button is pressed you would set it to true, then back to false when the mouse was released.

Travis

Posted: Sat Nov 01, 2008 8:11 pm
by Atz666
I tried the part with setInputReceiverEnabled() but that one stops all input and I'd just like the mouse to be disabled...