How to disengage FPS cam to use mouse on gui?
How to disengage FPS cam to use mouse on gui?
Currently using irrlicht engine for a small yet to be announced project.
Its in fps mode but i need and have use to use the gui with mouse too. So i wonder how to keep the current camera but disengage the mouse from the fps to use it normally klicking gui?
Greetings Athos
Its in fps mode but i need and have use to use the gui with mouse too. So i wonder how to keep the current camera but disengage the mouse from the fps to use it normally klicking gui?
Greetings Athos
(If someone read the previous, unedited version: forget it! )
Use setInputReceiverEnabled method of ICameraSceneNode. example:
Toma
Use setInputReceiverEnabled method of ICameraSceneNode. example:
Code: Select all
cam=scene::ICameraSceneNode* cam=smgr->addCameraSceneNodeFPS();
cam->setInputReceiverEnabled(false);
"This is not a bug, this is a feature!"
I haven't tried this, but maybe he could use the where he controls the camera with the left mouse button held down, and then have a separte event for click and release on his gui buttons?
I don't see why it wouldn't work.
Code: Select all
addCameraSceneNodeMaya()
I don't see why it wouldn't work.
because the maya camera blows ass... it's horrible even for maya.luckymutt wrote:I haven't tried this, but maybe he could use thewhere he controls the camera with the left mouse button held down, and then have a separte event for click and release on his gui buttons?Code: Select all
addCameraSceneNodeMaya()
I don't see why it wouldn't work.
How do i make the switch then. Becouse i need/want to switch on the fly. But it seems i have to rewrite irrlicht engine fps camera event revicer kode in that case? or?
Becouse our eventrevicer dosnt get any messages while the fps camera is engaged. So someone i have to add a keypress event on the fps camera event revicer so it sets eventrevicer = false;
any idea how?
Best regards athos
Becouse our eventrevicer dosnt get any messages while the fps camera is engaged. So someone i have to add a keypress event on the fps camera event revicer so it sets eventrevicer = false;
any idea how?
Best regards athos
Maybe try some thing like:
That ought to implement releasing the camera on the first key press, so you can then carry on with your mouse click events, then return to the camera on a second key press.
I have used this to make scene nodes switch, but have never tried it with camera and mouse visiblity.
Code: Select all
if (event.EventType == irr::EET_KEY_INPUT_EVENT&&
!event.KeyInput.PressedDown)
{
switch(event.KeyInput.Key)
{
case KEY_KEY_X:
if (camonoff==2)
{
camonoff=0;//to loop
}
camonoff = camonoff + 1;
if (camonoff==1)
{
cam->setInputReceiverEnabled(false);
device->getCursorControl()->setVisible(true);
}
if (camonoff==2)
{
cam->setInputReceiverEnabled(true);
device->getCursorControl()->setVisible(false);
}
}
return true;
}
}
return false; }
};
I have used this to make scene nodes switch, but have never tried it with camera and mouse visiblity.
ok that dosnt work since the irrlicht builtinf camerafps has its own event revicer so my eventrevicer wont get messages at all.
Somehow i need to access the irrlicht fps camera event revicer. becouse its that one who revices the key presses too. and have that one self turn it off some how.
Greetings Athos
Somehow i need to access the irrlicht fps camera event revicer. becouse its that one who revices the key presses too. and have that one self turn it off some how.
Greetings Athos
I think you are wrong there. Becouse how to disable it if i cant catch the events my self? If you know how to disable it. Please tell me maby show some code i would appriciate it very much.RabidLockerGnome wrote:nah no need to edit the source or anything. disabling the camera's event receiver should work just fine, i think this is how i went about it. so when u have to bring up the gui, disable the event receiver, and when ur done with that, enable it again. easy as that.
And even if i did disable it and used my normal event revicer i couldnt enable it again and i donno why.
-Athos
I'm not sure I'm understanding what you're trying to do here. If you don't want the camera to react to mouse and key events, use the setInputReceiverEnabled() function. this might not be exactly what we're looking for, but i cant exactly remember what i myself used to accomplish this. when i get home from uni, i'll have to run a few things to see what'll make this work. so what exactly are u using this for? bringing up an in-game gui or something?
http://jaguar.aug.edu/mricha11/RLG_Test.cpp
try that out
just hacked up source from the tutorials. but u get the point.
try that out
just hacked up source from the tutorials. but u get the point.