From Stephan Hunber, "attached you’ll find some changes to osg/p3d:

* a new command-line-option to present3d and a new option to the p3d-plugin to suppress any found <env> tags
* a new command-line-option to present3d to forward mouse-events via osgGA::Device (defaults to off) so we can test the interface-files with present3d better
* I added a new attribute forward_to_devices for click_to_event to forward the event to all attached devices instead of handling the event locally. This will fix the annoyance with the new interface-files when toggling polygon-mode or switching light on/off.

Here’s an example:

<click_to_event forward_to_devices="true">0x72</click_to_event>
"
This commit is contained in:
Robert Osfield
2013-12-19 13:49:27 +00:00
parent 02120e188e
commit f16f278fea
5 changed files with 119 additions and 27 deletions

View File

@@ -110,22 +110,25 @@ struct HomePosition : public virtual osg::Referenced
struct KeyPosition
{
KeyPosition(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX):
KeyPosition(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices = false):
_key((osgGA::GUIEventAdapter::KeySymbol)key),
_x(x),
_y(y) {}
_y(y),
_forwardToDevices(forward_to_devices) {}
void set(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX)
void set(unsigned int key=0, float x=FLT_MAX, float y=FLT_MAX, bool forward_to_devices = false)
{
_key = (osgGA::GUIEventAdapter::KeySymbol)key;
_x = x;
_y = y;
_forwardToDevices = forward_to_devices;
}
osgGA::GUIEventAdapter::KeySymbol _key;
float _x;
float _y;
bool _forwardToDevices;
};
struct LayerCallback : public virtual osg::Referenced
@@ -313,6 +316,7 @@ public:
bool getLoopPresentation() const { return _loopPresentation; }
void dispatchEvent(const KeyPosition& keyPosition);
void forwardEventToDevices(osgGA::Event* event);
void setRequestReload(bool flag);
bool getRequestReload() const { return _requestReload; }