FPS Camera only when mouse is clicked?

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
Atz666
Posts: 5
Joined: Sat Nov 01, 2008 5:44 pm

FPS Camera only when mouse is clicked?

Post 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!
XXChester
Posts: 95
Joined: Thu Oct 04, 2007 5:41 pm
Location: Ontario, Canada

Post by XXChester »

When you click the mouse just create a FPS camera and make it the active camera, I think that will work.
vitek
Bug Slayer
Posts: 3919
Joined: Mon Jan 16, 2006 10:52 am
Location: Corvallis, OR

Post 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
Atz666
Posts: 5
Joined: Sat Nov 01, 2008 5:44 pm

Post by Atz666 »

I tried the part with setInputReceiverEnabled() but that one stops all input and I'd just like the mouse to be disabled...
Post Reply