Page 1 of 1

CSceneManager::postEventFromUser

Posted: Fri Apr 12, 2013 10:00 pm
by clarks

Code: Select all

 
bool CSceneManager::postEventFromUser(const SEvent& event)
{
    bool ret = false;
    ICameraSceneNode* cam = getActiveCamera();
    if (cam)
        ret = cam->OnEvent(event);
 
    _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
    return ret;
}
 
This only allows cameras to receive events when they are sent to the scene-manager. I understand that if this was enabled for all nodes it would degrade performance. But it just makes sense that it should.

Re: CSceneManager::postEventFromUser

Posted: Sat Apr 13, 2013 10:51 am
by Mel
It is a method exposed for utility reasons only. Normally you don't use that method to post user events. Use the IrrlichtDevice->postEventFromUser instead.

http://irrlicht.sourceforge.net/docu/cl ... 31e48e01df

This reaches properly your eventManager, making it posible for you to handle your nodes as you wish.

Re: CSceneManager::postEventFromUser

Posted: Sat Apr 13, 2013 3:32 pm
by clarks
It is a method exposed for utility reasons only.
This is understood. But the point that I am making is that this function can only post to the active camera.
Normally you don't use that method to post user events.
I never do this. All events come through the device. I am just taking a look at some of irrlicht api design.