Hi Guys,
I've just checked in the addition of the following methods to Dragger
that enable one to control when the draggers can be activated by
clicking on them :
void setActivationModKeyMask(unsigned int mask) {
_activationModKeyMask = mask; }
unsigned int getActivationModKeyMask() const { return
_activationModKeyMask; }
void setActivationKeyEvent(int key) { _activationKeyEvent = key; }
int getActivationKeyEvent() const { return _activationKeyEvent; }
Usage looks like (from the new rev of the osgmanipulator example):
// if we don't set an activation key or mod mask then any mouse click on
// the dragger will activate it, however if do define either of
ActivationModKeyMask or
// and ActivationKeyEvent then you'll have to press either than
mod key or the specified key to
// be able to activate the dragger when you mouse click on it.
Please note the follow allows
// activation if either the ctrl key or the 'a' key is pressed and
held down.
dragger->setActivationModKeyMask(osgGA::GUIEventAdapter::MODKEY_CTRL);
dragger->setActivationKeyEvent('a');
I've added these extra controls so that we can have manipulators on
screen at the same time as being able to have the standard camera
manipulators active (i.e. the camera trackball). Previously the
example had an event handle change modes via presses to the tab key,
but this was rather awkward to use. One can still implement this
approach if you wish just by toggling the
Dragger::setHandleEvents(bool) for you own event handler.
Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org