To the Lua plugin added support for assigned lua functions to C++ osg::Objects via the new osg::CallbackObject mechanism. To invoke the scripts function from C++ one must get the CallbackObject and call run on it.
Renamed ScriptCallback to ScriptNodeCallback to avoid possibly confusion between osg::CallbackObject and the ScriptNodeCallback.
One solution is naturally to create a new class that would inherit the osg::ComputeBoundVisitor, and use that. I don't like that idea as the ComputeBoundVisitor does actually have what I need - it is only hidden in a protected function.
I am therefor suggesting a slight generalization of the ComputeBoundVisitor with the attached patch, which is tested.
The patch has two parts:
we add applyBBox() so that one can use that in a customized traverse-function and add a bbox to the visitor. I considered calling this function expandByBBox(), but I though applyBBox was better.
The MatrixStack is made available to the outside world. That enables a traverse-function to do whatever it wishes.
I do actually only need one of the two, as I can implement what I wish either way, but adding getMatrixStack() will make more generic expansions possible.
"
From Robert Osfield, changed the name of the new applyBBox(..) method to applyBoundingBox(..) to keep it's naming more consistent with the rest of the OSG.
I added a new tag to p3d called forward_touch_event_to_device and renamed the existing forward_event_to_device to forward_mouse_event_to_device. This new tag will transmit touches to the virtual trackpad as touch events. I added the MultitouchTrackball to the p3d-app so zooming and moving a model remotely should now work, if you use forward_touch_event_to_device. I kept (and fixed) forward_mouse_event_to_device for background compatibility, so old presentations works as in previous versions, without the ability to zoom + scale. of course.
forward_touch_event_to_device needs some more testing, (e.g. with image-streams and keystone, afaik there’s no support for touch-events...) but for a first version it works nice.
"
From Robert Osfield, changed Roni's code to use a #define GETDEVICEPIXELRATIO to access the versioned Qt devicePixelRatio() method to avoid duplication of the Qt version checking.
....
GUIEventHandler: In copy constructor 'osgGA::GUIEventHandler::GUIEventHandler(const osgGA::GUIEventHandler&, const osg::CopyOp&)':
/include/osgGA/GUIEventHandler:56:9: error: base class 'class osg::Object' should be explicitly initialized in the copy constructor [-Werror=extra]
It seems the diamond problem:
A = osg::Object
/ \
/ \--> Virtual inheritance
B C
\ /
\ /
D = EventHandler
|
|
E = GUIEventHandler
The most derived class(E) handles the instantiation of A (osg::Object), but all have to be responsible in case they are the ones instantiated.
In case A is not initialized in the copy constructor of derived classes the default constructor will be called, which seems a bug.
I've added osg::Object to the initalization list of EventHandler and GUIEventHandler copy constructors, because both classes are instantiables.
"
Updated lua plugin to use new osgDB::PropertyInterface to run methods.
Added addChild/removeChild() etc to Group.cpp, and addDrawable/removeDrawable() etc. to Geode.cpp serializers.
* 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>
"
* MultiTouchTrackball: some code cleanup and support for normalized touch-points
* oscdevice: receiving and sending multi-touch-events via the Cursor2D-profile from TUIO
* added some documentation
Added new WindowSystemInterface::setDisplaySettings() method to provide a mechanism for passing settings onto the WindowSystemInterface so it can then set up the system appropriately.
Added assignment of the DisplaySettings to the WindowSystemInterface in Viewer/ComppsiteViewer::realize().
the wrappers it contains. The registration creates a prototype
object for all of the wrapped classes. For some of the higher-level
classes this can be a bit heavy.
I noticed a problem with a model which required a single class from
osgSim. When osgdb_serializers_osgsim.so was loaded it registered
wrappers and created prototype objects for all of the osgSim classes,
including osgSim::ScalarBar. The constructor for that class creates
several drawables, and loads arial.ttf using the freetype plugin. I
don't need that, and don't even ship the font or plugin with my
application, resulting in an unexplained warning message loading
the model.
I've modified the ObjectWrapper class to defer the prototype object
creation until if & when actually required."
To make easier "lazy apply" on the customer OpenGL shaders, the easiest way was to add an accessor to current OSG state's UniformMap.
I've also added accessors for modes and texture, since it could be usefull in the same way.
All methods are const, so I think there is no side-effects."
I've also checked the modified files still build ok with other
compilers (Linux gcc, Windows Visual Studio).
osgDB/OutputStream.cpp and osgPlugins/lws/SceneLoader.cpp require
stdlib.h for atoi use.
In osg/Uniform.cpp the compiler complains that base_class is unknown
unless I add a class name qualifier.
Not a build fix, but I spotted a typo in osgUtil/SceneView."