Commit Graph

4006 Commits

Author SHA1 Message Date
Robert Osfield
12a737ae02 Changed the Node::ParentList to be a list of osg::Node rather than osg::Group, and added addChild, removeChild, replaceChild virtual method to Node to enable code
to user code compile with minimal modifications to account for the new change to the Node ParentList.
2014-05-13 08:43:07 +00:00
Robert Osfield
b2c7bacfe9 From Farshid Lashkari, "As discussed, I've added the ability to handle Drawable objects within the NodeVisitor class. Here is an overview of the changes:
- Added apply(Drawable) and apply(Geometry) to NodeVisitor

- Added accept(NodeVisitor) method to Drawable/Geometry

- Added traverse(NodeVisitor) to Geode which calls accept(NodeVisitor) on all Drawables

- Updated CullVisitor to use new apply(Drawable) to handle drawables. The apply(Billboard) method still manually handles the drawables since it is depends on the billboard settings. I needed to disable the traverse within billboard to prevent duplicate traversal of drawables.

- Update other osgUtil node visitors (GLObjectsVisitor, IncrementalCompileOperation, ..) to use new apply(Drawable) method.
"
2014-05-12 12:10:35 +00:00
Robert Osfield
ead92353fe Added beginnings of new osgUI library, a replacement for osgWidget that works fully in 3D/stereo and is scriptable. 2014-05-12 11:27:54 +00:00
Robert Osfield
298f1c65b6 Renamed the new include/osg/OpenGL automatically configured header file to include/osg/GL replacing the original hand built GL header 2014-04-30 13:19:22 +00:00
Robert Osfield
e16eb147a1 From Sebastian Messerschmidt, "attached is the compile/linker fix for multiple definitions of getTypeEnum when compiling the Lua with VisualStudio and potentially other compilers.
"
2014-04-30 11:51:40 +00:00
Robert Osfield
a04232a75a From Pjotr Svetachov, "have added some missing serializers for RigGeomery. Withouth them I
ran into two issues.

At first you get a bunch of warnings that osg::ComputeBoundCallback
and osg::UpdateCallback were unsupported wrapper classes when
converting fbx models with skeletal animation to osg(t/b).

The second issue was that when reading, the readers fail to read the
ComputeBoundCallback and UpdateCallback and set them to NULL which
messes up the RigGeometry.

Because a RigGeometry makes his own classes in the constructor it
might be preferable to not write them at all, because now those
classes are being made two times when reading a RigGeometry. But after
thinking about this that would place too much limits on them (you
won't be able to share or name them and save that information or make
a new inherited class from them and write that one) So I ended up
thinking the best way was to just write the files.
"
2014-04-29 15:14:39 +00:00
Robert Osfield
b6404d18c3 From Pjotr Svetachov, "Today I found a bug in the IutputStream class when saving array
attributes in vec3b format. It looks like my compiler takes the wrong
overload and outputs integers instead of characters. The problem is
that vec3b is of type signed char and that is not the same as char (
see http://stackoverflow.com/questions/436513/char-signed-char-char-unsigned-char
) and visual studio 2013 will promote it to integer when choosing an
overload.
It looks like that the InputStream class already takes care of this
issue (if it didn't it would have read everything ok and I would have
not even stumbled upon this bug. :) )"
2014-04-29 13:41:35 +00:00
Robert Osfield
bc5575f83a From Kristofer Tingdahl, "I and my team have gone over the code again, and we feel that we are comfortable in our current proposal for change. It goes deeper than it did before, and I explain why:
There was code in the osgViewer/Viewer.cpp and osgViewer/CompositeViewer.cpp that transformed the Y-coordinates of an event. The code in the composite viewer did however miss the touch-data of the event. I thought that it should really be the GUIEventAdapter that should know about this, and hence I added the
GUIEventAdapter::setMouseYOrientationAndUpdateCoords which is re-computing the coordinates. First I simply added a boolean to the setMouseYOrientation function:

setMouseYOrientation( MouseYOrientation, bool updatecooreds=false );

but then the serializer complained.

This function is called from both the Viewer and the CompositeViewer. We have not tested from the viewer, but I cannot see it would not work from visual inspection.

The other change is in MultiTouchTrackballManipulator::handleMultiTouchDrag. I have removed the normalisation. The reason for that is that it normalised into screen coordinates from 0,0 to 1,1. The problem with that is that if you have a pinch event and you keep the distance say 300 pixels between your fingers, these 300 pixels represent 0.20 of the screen in the horizontal domain, but 0.3 of the screen in the vertical domain. A rotation of the pinch-fingers will hence result in a zoom in, as the normalised distance is changing between them.

A consequence of this is that I have changed the pan-code to use the same algorithm as the middle-mouse-pan.

The rest of it is very similar from previous revision, and there has been some fine-tuning here and there.

"
2014-04-24 17:14:54 +00:00
Robert Osfield
ef76994c05 Removed header as this CMake generated configuration file is not required to be part of svn repository 2014-04-24 07:20:44 +00:00
Robert Osfield
a1342a6bf6 Added src/osg/OpenGL.in configuration file and include/osg/OpenGL header files 2014-04-23 19:30:33 +00:00
Robert Osfield
5597248895 Introduced new scheme for setting up which version of OpenGL/OpenGL ES the OSG is compiled for.
To select standard OpenGL 1/2 build with full backwards and forwards comtability use:

  ./configure
  make

OR

  ./configure -DOPENGL_PROFILE=GL2

To select OpenGL 3 core profile build using GL3/gl3.h header:

  ./configure -DOPENGL_PROFILE=GL3

To select OpenGL Arb core profile build using GL/glcorearb.h header:

  ./configure -DOPENGL_PROFILE=GLCORE

To select OpenGL ES 1.1 profile use:

  ./configure -DOPENGL_PROFILE=GLES1

To select OpenGL ES 2 profile use:

  ./configure -DOPENGL_PROFILE=GLES2


Using OPENGL_PROFILE will select all the appropriate features required so no other settings in cmake will need to be adjusted.
The new configuration options are stored in the include/osg/OpenGL header that deprecates the old include/osg/GL header.
2014-04-23 09:08:26 +00:00
Robert Osfield
560587c88f Fixed comment 2014-04-14 16:16:08 +00:00
Robert Osfield
25ddbf8f1f From Sebastian Messerschmidt, "n the trunk version the osgGA::GUIActionAdapter has additional functions for lineIntersection which use osgGA::GUIEventAdapter&, but the class declaration is neither forwarded, nor is the header included.
Using the trunk together with osgEarth 2.5 will fail to build, due to the missing type.

Attached is the file forward declaring osgGA::GUIEventAdapter."
2014-04-08 11:48:34 +00:00
Robert Osfield
efc493cfa0 Fixed build when using of double BoundingBox/BoundingSphere 2014-04-07 15:04:34 +00:00
Robert Osfield
ac380e03c4 From Paul Martz, "We discussed the issue of GL_RED_SNORM and GL_RG_SNORM some time ago, but the issue was never completely resolved. Please see the attached submission to fix the issue.
osg/GL2Extensions was incorrectly defining GL_RED_SNORM and GL_RG_SNORM as part of the definitions for OpenGL v3.1. However, a quick review of the 3.1 spec indicates that these are not part of the 3.1 standard.

My attached change moves these definitions out of the #ifndef GL_VERSION_3_1 conditional block, and defines them conditionally if not already defined. This allows the DDS plugin to build for GL3.
"
2014-04-07 13:48:15 +00:00
Robert Osfield
e5fe59799d Fixed handling of volume tiles with a region. 2014-04-01 18:33:02 +00:00
Robert Osfield
27b71e3927 Added cube and hull rendering support 2014-03-27 12:47:44 +00:00
Robert Osfield
2f8b0f7a70 Restructured the handling of TileData to make it more extensible and flexible. 2014-03-19 17:56:40 +00:00
Robert Osfield
d7944b6ca9 Addd ExteriorTransparencyFactorProperty for support of upcomming functionality of rendering a cube volume with a hull volume inside it. 2014-03-18 18:14:15 +00:00
Robert Osfield
ed724a730e Added support for animating volume hulls. 2014-03-17 15:54:52 +00:00
Robert Osfield
ea865d0ff9 Added support for directly invoking scripts using <run-script> and <run-script-file> to enable scripts to interact with each other. 2014-03-13 10:28:18 +00:00
Robert Osfield
8f30a262f4 Added PresentationInterface class to make it more convinient to access the current presentation from scripting languages 2014-03-11 10:52:10 +00:00
Robert Osfield
ee266255eb Added scripting support for JumpData, KeyPosition, HomePosition and parts of SlideEventHandler that enable dispatching of user created events. 2014-03-10 19:08:46 +00:00
Robert Osfield
9319350176 Added support for osg::Image to the lua plugin. 2014-03-06 10:27:26 +00:00
Robert Osfield
218e36b12b Relaxed the handling of Image objects 2014-03-04 13:35:27 +00:00
Robert Osfield
de09adcaa9 Added MapReverseIterator implementation. 2014-02-27 10:02:55 +00:00
Robert Osfield
46381cb15c Added MapIteratorObject and support for it in the lua plugin to provide map iterator functionality. 2014-02-26 18:18:08 +00:00
Robert Osfield
9394215d31 Added Map serializer size() method and support for it in the lua plugin. Renamed functions in lua plugin to be more consistent. 2014-02-26 11:01:35 +00:00
Robert Osfield
69e9f2c973 Added support for vector and map containers in osgDB::Serailizer's and lua plugin. 2014-02-26 08:26:51 +00:00
Robert Osfield
4ef5d9eb5f Added Vector serialization and support in lua plugin top enable script users to set/get vector properties such as osg::Array, osg::PrimitiveSet and children lists. 2014-02-24 10:19:48 +00:00
Robert Osfield
cb805d7be5 Added inital cut of PrimitiveSetSet wrappers to scripting 2014-02-13 11:01:36 +00:00
Robert Osfield
743a6b049c Added initial support for wrapping osg::Array in a way that can be used via scripting. 2014-02-12 18:03:53 +00:00
Robert Osfield
8bbbea1274 Fixed handling of assignment of User Object's that replace existing Object with the specified propertyName. 2014-02-11 18:18:48 +00:00
Robert Osfield
2797e8cb7c Improved support for setting/getting properties via the osg::UserDataContainer. 2014-02-11 18:07:37 +00:00
Robert Osfield
31e98b51df Added support for serailizing and scripting BoundingBox and BoundingSphere objects 2014-02-10 16:44:13 +00:00
Robert Osfield
3dcca431a9 Fixed handling of setting member variables via the Serializers when the value is the default.
Added support for more features of the osgDB::Widget class.

Fixed handling of boolean values in the Lua plugin
2014-02-08 17:53:51 +00:00
Robert Osfield
1319c2d281 Added support for enum's in the Lua script integration 2014-02-08 10:39:20 +00:00
Robert Osfield
8eae4b0381 Fixed export 2014-02-08 10:38:51 +00:00
Robert Osfield
6f5e5c23df Added initial Widget wrapper 2014-02-07 10:46:16 +00:00
Robert Osfield
4016aed62d Moved experimental Widget class to osgGA
Add computeIntersections() to the osgGA::GUIActionAdapter base class to enable intersection tests without needing to directly link to osgViewer.
2014-02-06 17:32:41 +00:00
Robert Osfield
99eb81e743 Added support for casting objects to allow one to access a parent classes methods. 2014-02-06 11:25:37 +00:00
Robert Osfield
2b8be97297 Added support for a <hull> tag that can be used within <volume> tag. 2014-02-05 11:07:03 +00:00
Robert Osfield
5f8e2bda2f Added osg::CallbackObject to be used to extend C++ class from scripting languages by providing callback objects assigned to the osg::Object UserDataContainer, with the CallbackObject's Name used to map the "method" provided by the CallbackObject. The CallbackObject is implemented by the script engine to provide the neccessary glue to invoking the script with the appropriate input parameters and handling the output parameters.
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.
2014-01-31 16:20:29 +00:00
Robert Osfield
d63c6f6978 From Kristofer Tingdahl, made method virtual 2014-01-28 16:49:20 +00:00
Robert Osfield
4f19237467 Removed unimplemented method 2014-01-27 15:43:36 +00:00
Robert Osfield
15f44c8736 Added a getModeUsage() method that prevents any mode being automatically associated with these Texture types that are only usable using non fixed function pipeline. 2014-01-24 12:01:37 +00:00
Robert Osfield
d8482ef1ba From Kristofer Tingdahl,"we have a bunch of classes that inherit osg::Node, and they create their own, internal geometry which is passed into the render bucket at the cull-traversal. Last week, we realised that these classes are not accounted for when doing an ComputeBoundVisitor- traversal, as there is no specialization in ComputeBoundVisitor for them.
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.
2014-01-23 16:48:29 +00:00
Robert Osfield
a96ad565c7 From Stephan Huber, "attached are some fixes to the osc-plugin and the touch-implementations for iOS and os x and other small bugfixes. These fixes will normalize the orientation of the touch points, and transmitting the touch points over osc via the TUIO-protocol works now more robustly between two osg-applications.
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.
"
2014-01-23 15:37:48 +00:00
Robert Osfield
405cb0d828 Made protected methods virtual to allow subclassing to customize more aspects of the window setup. 2014-01-22 17:29:44 +00:00
Robert Osfield
1678dc3562 Added support for osgVolue::SampleRatioProperty. Fixed build errors when compiling with ref_ptr<> automatic type conversion. 2014-01-21 18:48:53 +00:00