A quick one: what’s the converse C++ call to get out of monitoring the camera with the mouse/trackball ?
setup_trackball(); // camera movement control with trackball
xxxxx_xxxxxxxx(); // ???? unset it ????
Thanks
A quick one: what’s the converse C++ call to get out of monitoring the camera with the mouse/trackball ?
setup_trackball(); // camera movement control with trackball
xxxxx_xxxxxxxx(); // ???? unset it ????
Thanks
Not sure about that one, don’t see anything in the doc, just the call to set it…
Try this and see if it works:
EventHandler *eh = get_global_event_handler();
eh->remove_all_hooks();
If you used EventHandler to set any event hooks then this will remove those too, but I’m wondering if setup_trackball makes calls to EventHandler add_hook, if it does, this should remove those callbacks. I hope there is a better answer to this…
Will have a look.
I’ve seen too something like ‘disable_mouse()’ I need to investigate.
A simple way would be to un-hook the camera node from the trackball, but I’ve not found yet the appropriate access to the data structure.
regards
jean-claude
Ok, a quick way is to simply :
NodePath trackballNP = window->get_mouse().find("trackball");
trackballNP.remove_node();
This appears to work fine, but who knows may have some side effect…
EDIT: it maybe preferable to remove the node “tball2cam” or replace it by a “tball2dummy” node in order to keep the trackball active for other matters…
BTW. Here is the way to access to tball2cam
NodePath tball_NP = window->get_mouse().find("**/+Trackball");
NodePath tball2cam_NP = tball_NP.find("tball2cam");
tball2cam = DCAST(Transform2SG,tball2cam_NP.node());