Commit Graph

8735 Commits

Author SHA1 Message Date
Robert Osfield
939aa38a2a Added SampleRatioWhenMoving property and support to new osgVolume::MultipassTechnique. 2013-12-12 09:53:24 +00:00
Robert Osfield
a5c0127a6e Applied unquie CullVisitor::Identifier rather than reusing the cloned one. 2013-12-12 09:51:30 +00:00
Robert Osfield
2501f32e9a Changed epsilon to 1e-5 to address picking problems with planaer objects 2013-12-11 17:20:14 +00:00
Robert Osfield
e3bf55a266 Added initial support for 1D transfer functions to MultipassTechnique 2013-12-11 12:00:27 +00:00
Robert Osfield
ff4a0ce1e2 Added support for handling viewports with offset origins, and with it split stereo. 2013-12-10 13:38:27 +00:00
Robert Osfield
bc95ea97fb Introduced SampleRatioValueProperty for more intuitive control of how many samples to take when volume rendering 2013-12-10 10:43:48 +00:00
Robert Osfield
499adba97f Improvements to new MultipassTechnique 2013-12-09 10:39:01 +00:00
Robert Osfield
3858acf70f Further work on new MultipassTechnique/VolumeScene. 2013-12-06 19:31:12 +00:00
Robert Osfield
ed4deeb0fb From Mike Krus, compile fix to enable compiling across a wider set of versions. 2013-12-06 09:35:57 +00:00
Robert Osfield
1b3290221c Added support for using shaders to render the RTT textures with depth 2013-11-26 19:03:46 +00:00
Robert Osfield
477951b924 Replaced readShaderFile() usage to readRefShaderFile() 2013-11-26 10:38:35 +00:00
Robert Osfield
4fcf8d3e86 Added initial render to texture functionality into osgVolume::VolumeScene 2013-11-25 17:36:17 +00:00
Robert Osfield
f02ed3c629 Warning fixes 2013-11-22 10:27:15 +00:00
Robert Osfield
d3a7115c45 Removed trailing spaces, added missing return to last lines 2013-11-22 09:38:50 +00:00
Robert Osfield
5bea13c172 Added new osgVolume::VolumeScene and osgVolume::MultipassTechnique class shells that will be filled out to provide multi-pass volume rendering that handles mixing of
3D meshes with volume rendering and segmentation of volumes via a user defined hull mesh.
2013-11-21 18:17:44 +00:00
Robert Osfield
1b269a7711 From Stephan Huber, "CLang / LLVM on OS X seems to have a problem compiling the osgGA-serializer. (It was reported before on the list, but the error is hard to track as it shows up only sometimes)
I fixed the compile-error with a dedicated destructor of osgGA::GUIEventHandler"
2013-11-21 14:21:55 +00:00
Robert Osfield
a5d78953d4 From Farshid Lashkari, "I recently encountered an issue attempting to load an IVE file generated by an older version of OSG. The file contained dxt1 compressed image data with mipmaps. The loaded model would cause crashes when passing the mipmap data to glCompressedTexImage2D. It seems that the size of the data array within the IVE file did not match the computed size from Image::getTotalSizeInBytesIncludingMipmaps(). This essentially made the mipmap offsets invalid within the Image object.
I'm not sure if the IVE was simply generated incorrectly, or if the Image::getTotalSizeInBytesIncludingMipmaps() was modified since the file was generated. Either way, I added a simple check in the IVE loader so that it clears the mipmap offsets if the actual data size does not match the computed data size. This seems like a safe fallback since the mipmap data can be automatically generated, and it fixes the problem in my case.

Also, while looking into this issue, I noticed that the osgDB::InputStream class applies the serialized image allocation mode. However, since the serializer is allocating the image data itself, it seems like it should force the allocation mode to USE_NEW_DELETE.
"
2013-11-21 13:59:00 +00:00
Robert Osfield
1e2bead9bc Converted std::max to osg::maximum to fix VS2013 build error 2013-11-21 11:02:08 +00:00
Robert Osfield
a54b999ccc Added Geometry::drawVertexArraysomplemetation(..) and drawPrimitivesImplemenation(..) methods that are called from drawImplementation(..). These new vertex methods
allow subclasses from osg::Geometry to specialize the vertex array setup or how the primitives are dispatched to OpenGL.
2013-11-21 10:31:34 +00:00
Robert Osfield
dbf88cc209 From Stephan Huber, "minor ios-fixes/-enhancements
* force _OPENTHREADS_ATOMIC_USE_BSD_ATOMIC for IOS device + simulator as the test does not pick the right implementation
* fixed a small compile-bug for iphone-example
* added a check to prevent multiple realization of a GraphicsWindowIOS-object
"
2013-11-18 14:21:06 +00:00
Robert Osfield
e0d3ab4412 From Stephan Huber, * GUIEventAdapter: add support for getting normalized touch points
* 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
2013-11-18 13:25:55 +00:00
Robert Osfield
c194e92df8 Moved Handled propety from GUIEventAdapter to Event base class.
Added CameraManipulator::finishAnimation() method to allow application code to stop any animation/throw of manipulators.
2013-11-15 16:15:09 +00:00
Robert Osfield
835d9455a9 Restored the rescaleToZeroToOneRange() to address rendering issues. 2013-11-12 14:21:00 +00:00
Robert Osfield
eede49d15c Removed unused variables 2013-11-11 10:55:51 +00:00
Robert Osfield
829cd9718a From Stepan Huber, "attached are my changes for the osc, zeroconf and resthttp-plugin to use the new event-class. I refactored the osgoscdevice-example so that it’s working again. " 2013-11-08 12:28:51 +00:00
Robert Osfield
25b8b8bd16 Quietened down debug messages 2013-11-08 12:25:35 +00:00
Robert Osfield
70c78264dc Changed the LineSegmentIntersector to RayIntersector to provide more reliable intersections with flat meshes. 2013-11-07 12:37:10 +00:00
Robert Osfield
7a2900e238 Added osgUtil::Intersector::PrecisionHint member and set it's default to USE_DOUBLE_COMPUTATIONS, and implemented support for use double or float maths internally in LineSegmentIntersector and RayIntersector classes 2013-11-07 12:35:34 +00:00
Robert Osfield
2ebe81cb0e Fixed handling of web cams 2013-11-06 09:49:51 +00:00
Robert Osfield
6f6c44446c Introduced a cast(T) method into the ImageUtils template functor to allow code reading images to handle casting from source data to a form that a user can use more conviently 2013-11-06 09:23:21 +00:00
Robert Osfield
ef3a65b93f Restructed the call to avformat_open_input to provide more information. 2013-11-06 09:20:35 +00:00
Robert Osfield
2b3665f010 Fixed typo 2013-11-05 15:23:32 +00:00
Robert Osfield
ff8fe4143e From Likasz Izebski, "added support for etc2/eac compression" 2013-10-28 12:03:55 +00:00
Robert Osfield
ac383e15c1 Added explict setting of the PolygonMode to over the distion mesh being toggled to wireframe. 2013-10-25 15:47:41 +00:00
Robert Osfield
4a660f6266 Introduce new osgGA::Event and osgGA::EventHandler base classes that the old GUIEventAdapter and GUIEventHandler now subclass from.
The new osgGA::Event is written to support more generic events than the original GUIEventAdapter which are written for keyboard and mouse events.
2013-10-25 14:54:15 +00:00
Robert Osfield
191eabd3ab Fixed warning 2013-10-25 09:02:39 +00:00
Robert Osfield
b3603f76e4 Removed depreated glib call 2013-10-24 19:56:04 +00:00
Robert Osfield
95e8d2838c Fixed FileInfo self intialization bug 2013-10-24 19:32:00 +00:00
Robert Osfield
1861e025e9 Fixed build problems with the OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION off 2013-10-24 17:43:02 +00:00
Robert Osfield
37fa2d698f From Stephan Huber, add support for controlling the OSXMenubarBehavior set by DisplaySettings. 2013-10-24 10:10:16 +00:00
Robert Osfield
234adf7daf Cleaned up addChild/getChild/setChild/getNumChildren methods and added readNodeFile, readImageFile and readObjectFile functions 2013-10-24 09:06:52 +00:00
Robert Osfield
f548bc79d4 Added support for Group::addChild/setChild/getChild/getNumChildren. 2013-10-23 16:17:26 +00:00
Robert Osfield
c45f3aa4fb Merged changes to DisplaySettings from Stephan Huber in prep for controlling the menu hiding behaviour under OSX.
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().
2013-10-22 19:12:34 +00:00
Robert Osfield
b7b7186cf8 Preliminary remapping of internalFormat for GL3 core profile 2013-10-22 18:58:15 +00:00
Robert Osfield
3dba54c10a Fixed warnings 2013-10-22 16:28:20 +00:00
Robert Osfield
1196f153fc From Colin McDonald, "The osgt/osgb file formats output a scenegraph node with the type
set to "SCENE" in the file header.  But if the file is stored and
then extracted again from an osga archive this header info is lost,
and the resulting file is just an "OBJECT".  Possibly other plugin
operations would have the same effect.  The osgt/osgb plugin won't
then return the scenegraph contents.

I have updated the osgt/osgb plugin to return a node from an "OBJECT"
file."
2013-10-22 11:32:21 +00:00
Robert Osfield
c34a8e4ddb From Colin McDonald, "The osgb file reader uses seek to position within the file.
But the nested stream implementation for osga archive files doesn't
support seeking.  So osgb files can't currently be used in an osga
archive e.g. if osgdem is used to output a osgb format database it
can't be packaged in an archive file, in the same manner that ive
files could.

I've added seek support to the osga nested stream implementation."
2013-10-22 11:26:45 +00:00
Robert Osfield
5ed399ca48 Fixed handling of osg::Program so that it's not overriden by shader composition when enabled 2013-10-22 11:18:28 +00:00
Robert Osfield
4493d11ca3 Added State::releaseGLObjects() and ShaderComposer::releaseGLObjects() to avoid problems with cleanup of graphics context 2013-10-21 16:35:12 +00:00
Robert Osfield
074eb8e41c Build fixes for clang 2013-10-21 09:54:41 +00:00
Robert Osfield
a68f0f26a8 From Farshid Lashkari, "previously discussed change to the dae loader which applies the node ID as a "dae_node_id" user value." 2013-10-18 09:57:49 +00:00
Robert Osfield
5bfb2ef26d From Konstantin Matveyev, "Multiple light fix in FBX-importer" 2013-10-18 07:55:26 +00:00
Robert Osfield
bddeecdbee From Colin McDonald, "Some missing updates to the serializer static build support." 2013-10-18 07:52:18 +00:00
Robert Osfield
49625a1baf From Andreas Henne, "in my application I use the TrackballDragger, the ScaleAxisDragger and the TranslateAxisDragger. Unfortunately these draggers are very thin and they do not provide methods to change their visual appearance. Another problem that I noticed is that lighting on the cones and boxes of the TranslateAxisDragger and ScaleAxisDragger is incorrect when the draggers are scaled due to not normalized normals. This small patch adresses these problems, providing methods to make the draggers thicker. I have attached a zip archive containing the corresponding files and also a modified osgManipulator example that makes use of the modifications. I don't want to retain any copyright." 2013-10-18 07:31:22 +00:00
Robert Osfield
a97e092619 Fix for error in getting the uniform block max name length, fix suggested by Christopher Fennell. 2013-10-17 18:29:39 +00:00
Robert Osfield
eb7c2ae3f7 Added set/get to the ImageSerializer and removed some redudent comments 2013-10-10 20:43:03 +00:00
Robert Osfield
cd86995d7d From Pjotr Svetachov, "With the new osg::Geometry the binding for arrays now default to undefined. This breaks previously working code in osgAnimation::RigTransformHardware where the arrays got an undefined bounding and because of this the bone indices and weights were not loaded by the shader. Here is a little patch to fix this." 2013-10-10 20:42:24 +00:00
Robert Osfield
4e4d2b35cf Added get/set method to Serializer to allow pointer passing without going through InputStream/OutputStream. 2013-10-10 09:28:26 +00:00
Robert Osfield
9c53794bc7 Implemented preliminary readNode/readImage support in the lua plugin allow a lua script to create a scene graph as return it. 2013-10-09 15:32:56 +00:00
Robert Osfield
e8b5272b02 From Stephan Huber, "attached you’ll find a bunch of fixes + enhancements for iOS and OS X based on current trunk. I incorporated + tested the submission from Colin Cochran, so his submission is not needed anymore.
* fixed a bug with multi-touch and touch-id-generation on iOS and OS X. (will fix a bug reported by Colin Cochran, without ditching the existing logic)
* removed unnecessary warning-flagss when generating xcode-projects via cmake, will enable the usage of OSG_AGGRESSIVE_WARNING_FLAGS
* added support for 10.9 (OS X)
* new cmake-variable: IPHONE_VERSION_MIN, this will set the deployment-target (previously hard-coded) If you set the IPHONE_VERSION_MIN to something like 7.0 osg gets compiled also for 64bit (amd64)
* cmake defaults now to the clang compiler if IPHONE_VERSION_MIN > 4.2
* cmake now sets some xcode-settings so the compiler uses the c++98-standard (clang defaults to c++11, w/o this I got a lot of linking errors)
* removed include-dir for avfoundation-plugin as not needed on OSX/IOS.
* enhanced the ios-example, will now show multitouch-information on a hud (similar to the  osgmultitouch-example), and more importantly, will compile + link out of the box
* small enhancements for the osc-device-plugin (send only one msg for MOVE/DRAG, even if multiple msgs/event is enabled)
* better memory-handling for the zeroconf-plugin
* fixed a possible bug in the rest-http-plugin when receiving mouse-events.
* incorporated a fix from Colin Cochran "forwarded touch events are not transformed into the GL UIView“
"
2013-10-07 10:05:09 +00:00
Robert Osfield
da2d7e2dde Added support for automatically select Lua 5.2 is it's available, then falling back to checking for Lua 5.1 otherwise. 2013-10-04 20:42:23 +00:00
Robert Osfield
d260b16981 Moved code across to use lua_userdata to manage pointer to osg::Object that is ref()/unref() 2013-10-04 19:48:03 +00:00
Robert Osfield
79e2d1309f Added support for Lua 5.2 and osg::Object creation from within Lua scripts. 2013-10-04 16:30:25 +00:00
Robert Osfield
c77dc4fe9e Added createObject() interface 2013-10-04 16:29:45 +00:00
Robert Osfield
83c396b13b From Jan Peciva, RayIntersector implementation 2013-10-03 08:45:57 +00:00
Robert Osfield
69f2fb56b3 From Colin McDonald and Robert Osfield, "When a serializer shared library is loaded it registers all of
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."
2013-10-02 13:59:00 +00:00
Robert Osfield
0ec35d5a5d From Dmitry Marakasov, "These are FreeBSD bits for src/osgPlugins/osc/osc/OscHostEndianness.h,
required to build newever OSG on this OS. Also corrects file name
in the error message - I was confused not to find OSCHostEndianness.h
after I've got this error.

Tested by successfully building OSG 3.2.0 with this patch on FreeBSD
9.1."
2013-10-02 11:29:58 +00:00
Robert Osfield
60d4b71d2b From Björn Hein, "it seems that for generating "per vertex normals" as stated in the
comment, two of them are missing. This results in wrong display of
STL-files regarding normals. Following simple fix seems to work:

Index: ReaderWriterSTL.cpp
===================================================================
--- ReaderWriterSTL.cpp    (Revision 13797)
+++ ReaderWriterSTL.cpp    (Arbeitskopie)
@@ -108,6 +108,8 @@
                     ++itr)
                 {
                     perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
+                    perVertexNormals->push_back(*itr);
                 }

                 geom->setNormalArray(perVertexNormals.get(),
osg::Array::BIND_PER_VERTEX);
"
2013-10-02 11:09:29 +00:00
Robert Osfield
59caf4a48e Fixed build with no automatic ref_ptr<> conversion 2013-10-01 19:34:21 +00:00
Robert Osfield
270883d3f4 From Björn Blissing, "I propose making the following outputs a little bit more silent. In my mind it would suffice with OSG_DEBUG (compared to OSG_NOTICE) for these information messages." 2013-10-01 16:20:20 +00:00
Robert Osfield
c399db82a3 From Christopher Baker, submitted by Alberto Luacas, "there is a bug report in the Ubuntu tracker that points to a bug when
loading multiple VRML files in parallel.  Christopher R. Baker has
detected this bug and crafted a patch.  In addition, libcoin has to be
also built with the "--enable-threadsafe" option.

I copy here his report, extracted from
(https://bugs.launchpad.net/ubuntu/+source/openscenegraph/+bug/1211993)
and attach his fix.  All credit is due to him:

«
There are three instances of a classical method-local-static
multithreaded initialization bug in the Inventor plugin for OSG that
trigger various memory faults when reading multiple VRML files in
parallel via osgDB::readNodeFile. These bugs are of the form:

static std::map<Stuff,OtherStuff> myHandyMap;
static bool once = true;
if(once) { ...fill myHandyMap; once = false }
... use myHandyMap;

To repeat: try loading multiple VRML files from multiple threads. The
liklihood of the bug depends on many factors, but my application, which
parallel-loads some dozens of small (<100K) VRML files on startup,
triggers this problem 25% of the time or more.

The attached patch (inventor-plugin-multithread.patch) rectifies this
problem by:

1 - Inheriting MyHandyMap from std::map, then
2 - Moving the map initialization into the derived constructor, which
3 - Is intrinsically protected from multithread issues by g++ (and is
part of the C++ standard), unless you pass -fno-threadsafe-statics,
which is strongly discouraged by the man page.
»
"
2013-10-01 09:37:56 +00:00
Robert Osfield
76d833f332 From Adrien Grandemange, "On Windows 7 and 8, mouse messages are generated in addition to touch messages, which leads to duplicate PUSH, DRAG and RELEASE events in OSG. Besides, the mouse and touch messages referring to the same user input are not necessarily sent at the same time, due to gesture translation done by Windows by default, such as double-tap => double-click and long-push => right-click.
The delay between the 2 types of messages is more noticeable on Windows 8 and leads to serious disruptions in our application.

Mouse messages generated by touch input are only present for legacy support. I think they should be filtered out by OSG (real click events originating from a physical mouse will of course still go through).

This is what this patch does, according to this suggestion: http://msdn.microsoft.com/en-us/library/dd693088%28v=VS.85%29.aspx (third issue in this page)."
2013-10-01 09:11:26 +00:00
Robert Osfield
68c22efa58 From Thomas Hogarth, "Attached is a small build fix for PointSprite when compiling under GLES2 (r13788)
GL_POINT_SPRITE_OES does not exist in GLES2, instead you just draw using GL_POINTS then use gl_PointSize in a vertex shader to set the size."
2013-10-01 09:05:18 +00:00
Robert Osfield
c626b0e1f6 From Jeffrey Kinross, "I ran into an issue with case sensitivity on OS X and the OSXAVFoundation code.
In CMakeList.txt there is a case sensitivity issue which a fix was posted by Robert Osfield in the users forum.

I also had to rename the files OSXAvFoundationCoreVideoTexture.h and OSXAvFoundationCoreVideoTexture.cpp to OSXAVFoundationCoreVideoTexture.h and OSXAVFoundationCoreVideoTexture.cpp

Finally in OSXAvFoundationCoreVideoTexture.cpp the include OSXAVFoundationVideo.H was updated to OSXAVFoundationVideo.h"
2013-09-30 18:32:41 +00:00
Robert Osfield
d304ed7d73 From Farshid Lashkari, "I have a scene that makes heavy use of the StateSet::compare method and my profiler showed that a lot of time was being spent inside it. I made a small change to the method so that it performs a quick size comparison between the attribute/mode lists and bin mode before iterating through all the attributes. This made a noticeable improvement in my scene. I've attached the change." 2013-09-30 18:15:51 +00:00
Robert Osfield
0ba856a637 2013-09-30 10:28:14 +00:00
Robert Osfield
8bc85764ff Unified Vec/Plane/Quat handling code. 2013-09-27 18:43:35 +00:00
Robert Osfield
ff925f1d86 Added support for getting Vec* and Matrix objects from Lua stack and assigning them as OSG object properties. 2013-09-27 13:04:04 +00:00
Robert Osfield
43cb1b3a41 Initial cut of setting and getting osg::Object properties within Lua scripts 2013-09-26 17:27:49 +00:00
Robert Osfield
6d8f40d13a Added support for passing parameters in and out of scripts.
Implemented support for osg::ValueObject in LuaScriptEngine.
2013-09-24 15:17:42 +00:00
Robert Osfield
796314c339 Changed NodeVisitor so that is subclasses from osg::Object rather than osg::Referenced to enable it to be used with serialization and scripting 2013-09-24 15:08:23 +00:00
Robert Osfield
3af70f13a3 Removed unnceccesary setNumChildrenRequiringUpdateTraversal from VolumeTile constructor. 2013-09-20 15:43:24 +00:00
Robert Osfield
8f3ee7c649 Added initial cut of white and black lists 2013-09-20 10:44:24 +00:00
Robert Osfield
6e3f893a0e Added type maps to help with querrying supported type names 2013-09-20 10:04:50 +00:00
Robert Osfield
250d9f2ed7 Introduce osgDB::PropetyInterface class that provided a generic interface for get/setting properties on scene graph objects, utilizing the osgDB serializers to do
the actual interface query and set/gets.
2013-09-19 16:19:32 +00:00
Robert Osfield
24ecfb1a48 Added access methods to Serializer to help with using wrappers for other purposes such as script integration.
Added Vec*i and Vec*ui support to serializers
2013-09-11 15:44:08 +00:00
Robert Osfield
31cd80cea7 From Giuseppe Donvito, "I'm using OSG 320 and I need to flush a DDS 3D texture on disk.
I found a bug on DDS ReaderWriter that generates a false positive on a guard for the size check on writing operation. This is due to a wrong imageSize computation that uses img->getImageSizeInBytes() method instead of img->getTotalSizeInBytes(), that actually ignores the r() dimension, contrariwise taken into account by the function ComputeImageSizeInBytes() later.

The line 1062 on file ReaderWriterDDS.cpp should be fixed with:
[code]unsigned int imageSize = img->getTotalSizeInBytes();[/code]
"
2013-09-10 15:17:59 +00:00
Robert Osfield
898c716841 Added osgPresentation::Show node and implementations with basic property reporting for various internal nodes of presentation graph 2013-09-10 09:23:30 +00:00
Robert Osfield
085bfd83d7 From Wang Rui, "The Python header will look for its libraries using "#pragma comment(lib,"python32_d.lib")" for MSVC. So user-specified libraries will not really be set for the osgdb_python plugin. This small fix may help locate the Python libraries after putting the CMakeLists.txt into src/osgPlugins/python
"
2013-09-09 16:02:32 +00:00
Robert Osfield
27b57dbf0c From Colin Cochran, OES support for point sprites 2013-09-09 14:58:25 +00:00
Robert Osfield
e9697859bd From Colin McDonald, "Add test for GL_EXT_framebuffer_object extension : osg uses osg::FBOExtensions to check if Frame Buffer Objects are
available.  But this just checks if the fbo functions can be called.
It doesn't check if the OpenGL renderer supports fbos.  For indirect
rendering on linux the client side capability may be different from
the display server, which can lead to mipmapped textures failing to
render.  I've added a fbo extension check.
"
2013-09-09 13:33:13 +00:00
Robert Osfield
61ccd56d25 From Laurens Voerman, "two minor fixes, both in a CMakeList.txt file,
1> osgmultiplemovies example does not use SDL so needs no link to SDL

2> Added header files to "Plugins osg" project, so visual studio can find the source of
   OSG_WARN <<  "AsciiInputIterator::readProperty(): Unmatched property "
"
2013-09-09 12:33:18 +00:00
Robert Osfield
7050c59cae Initial cut of Audio/Volume/Movie/Image presentation objects 2013-09-06 09:35:56 +00:00
Robert Osfield
df48d440e4 From Colin McDonald, "Attached are some fixes to build osg using the Solaris Studio compiler.
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."
2013-09-05 10:23:05 +00:00
Robert Osfield
94735a8364 From Laurens Voerman, "like the "Bug in ProxyNode serializer" Farshid Lashkari found (svn submit 13754) the PagedLOD serializer attempts to read begin and and brackets.
Fix is identical (don't read brackets when num_chidren is zero) and applies both to trunk and 3.2 branch."
2013-09-05 10:08:09 +00:00
Robert Osfield
19f84b52e7 Fixed warnings 2013-09-05 10:04:56 +00:00
Robert Osfield
0d2825e06f From Alberto Luaces, "current versions of ffmpeg render «url_feof» macro as obsolete. The fix
is very simple and it is contained in the attached file."
2013-09-05 08:42:00 +00:00
Robert Osfield
73250601f0 Added missing Model.cpp 2013-09-05 08:22:27 +00:00
Robert Osfield
856ec46467 Added PrintProperties visitor 2013-09-04 16:25:18 +00:00
Robert Osfield
ccf7bbdb50 Added PrintPropertiesAction to osgPresentation 2013-09-04 15:39:17 +00:00
Robert Osfield
9f5e131203 Added Action class NodeVisitor that supports osgPresentation nodes. 2013-09-04 10:33:11 +00:00
Robert Osfield
3c106e4dd7 Added test for osgPresentatation::Group::getSupportedProperties() 2013-09-03 15:50:28 +00:00
Robert Osfield
fdfe3210ce Added beginings of Text implementation 2013-09-03 10:17:06 +00:00
Robert Osfield
f5deda56a6 From Farshid Lashkari, "The ProxyNode serializer was not correctly reading the "Children" field. It conditionally writes the begin/end brackets, depending on whether it has children. However, during input it unconditionally attempts to read the begin/end brackets. I've modified the code to only read the brackets if it has children." 2013-09-02 10:56:48 +00:00
Robert Osfield
b9ecec6452 Refactored the use of epsilon in the clamping of the start/end points of the LineSegmentIntersector to better handle numerical precision issues. 2013-09-02 10:56:14 +00:00
Robert Osfield
698365e47f Fixed double copy in StackedTransform copy constructor 2013-09-02 09:12:24 +00:00
Robert Osfield
820ba45fab Added Audio, Image, Movie, Model and Volume class to osgPresentation. 2013-09-01 17:24:35 +00:00
Robert Osfield
ef32fab30e Added color property to FontData parsing 2013-08-23 11:42:52 +00:00
Robert Osfield
d7038e1be1 Quitened down debug message 2013-08-22 13:39:36 +00:00
Robert Osfield
11685a3e0c Removed debug messages 2013-08-22 12:37:49 +00:00
Robert Osfield
79c9aa7d02 Quitened down debug message 2013-08-22 12:07:55 +00:00
Robert Osfield
db449b9e09 Added warning when model file has not be found 2013-08-22 10:09:21 +00:00
Robert Osfield
464628b5c4 Reduced debug message level, and added a notify message for when an image isn't loaded 2013-08-22 10:05:29 +00:00
Robert Osfield
fcde15e136 Added test for serializers and fixed serializers 2013-08-22 07:49:22 +00:00
Robert Osfield
c678fed113 Added initial classes for present3D refactor 2013-08-21 19:54:03 +00:00
Robert Osfield
4e3715d4bb Moved old osgPresentation source files to osgPresentation/deprecated subdirectory. 2013-08-18 18:10:39 +00:00
Robert Osfield
bd7ec9c5f7 Added initial cut of basic scripting support, introducing an osg::Script object to wrap up the individual scripts, osg::ScriptCallback for assigning a Script as node callback and an osg::ScriptEngine base class that plugins implement to provided support for specific scripting languages.
Provided are lua, python and V8 (for javascript) plugins that just open up enough of a link to the respective libs to run a script, there is no scene graph <-> script communication in current implementation.
2013-08-09 16:51:06 +00:00
Robert Osfield
babd6e0ee7 Removed CameraNode reference 2013-08-09 11:00:55 +00:00
Robert Osfield
93ebfd6217 Added translucent version of cushion which isn't depth tested to enable one to see the cursor even when it's behind other objects 2013-08-08 17:21:20 +00:00
Robert Osfield
82401defc7 Added osgPresentation::Cursor class to wrap up 3D cursor in the scene functionality 2013-08-08 16:49:33 +00:00
Robert Osfield
0c609bc17e From Aurelien Albert, "I've go some problem with the method "State_Utils::replace" : if the original_phrase is empty, it leads to an infinite loop.
Here is a path to prevent this."
2013-08-05 12:00:34 +00:00
Robert Osfield
5f6a1f4093 From Anish Thomas, added catch for to an empty DrawElementsUInt creation. 2013-08-01 11:25:02 +00:00
Robert Osfield
14f63cbe67 From Ulrich Hertlein, "Based on the exchange on osg-users I went ahead and reworked shp/XBaseParser to avoid
weird behaviour (closing stdin) and leaking file descriptors, as well as some const-ness."
2013-08-01 10:28:12 +00:00
Robert Osfield
46ec50aecb From Sebastian Messerschmidt, "Seems like your re-factoring didn't really produces the correct results.
You can check with the tester2.flt provided earlier and check with the result image.
I double checked this with OpenFlight creator, and it seems the yaw is broken.

With my initial quaternion version is seems correct and if I change the


float cos_yaw = cosf(osg::inDegrees(yaw));
float sin_yaw = sinf(osg::inDegrees(yaw));

to be
float cos_yaw = cosf(osg::inDegrees(-yaw));
float sin_yaw = sinf(osg::inDegrees(-yaw));

it seems to work as well."
2013-08-01 10:04:05 +00:00
Robert Osfield
837a680849 From Tom Jolley, "I found a couple more bugs after closely looking at the small piece of deprecated geometry in my model. There were problems with more than one primitive in a couple places. The first was the number of vertices were not being accumulated for DrawArraysPrimitiveType (caused another crash). The second is I had to move target_vindex and source_pindex before the PrimitiveSetList loop so they don't get reset on the next primitive (otherwise you end up with a lot of zeros in per vertex lists)." 2013-08-01 10:00:31 +00:00
Robert Osfield
07365c1073 Added osg::RenderInfo::pushRenderBin()/popRenderBin() and RenderInfo::getRenderBinStack() and getCameraStack() access methods for getting access to the current RenderBin/RenderStage. 2013-08-01 07:19:45 +00:00
Robert Osfield
364e2765e7 Added Intersector::get/setEpsilon(double) to allow users to control what epsilon is used by the LineSegmentIntersector when doing testing of itersections with bounding boxes 2013-07-31 13:11:49 +00:00
Robert Osfield
9878a83894 From Tom Jolly, "I ran across this error reading one of our older files. An iterator was being changed inside a loop that caused a crash." 2013-07-31 06:56:31 +00:00
Robert Osfield
56cb7de72a From Sergey Kurdakov, fixed GLES2 invalid enumerant warning by disabling the check against GL_MAX_TEXTURE_COORDS under GLES. 2013-07-31 06:42:49 +00:00
Robert Osfield
0620f249a5 Changed default of serialize draw to off 2013-07-24 17:30:46 +00:00
Robert Osfield
75fd039dba Added GL2Extensions::isDrawBuffersSupported() and usage of this in FrameBufferObject.cpp to prevent crash under GLES2 when users attempt to use MRT when it's not supported 2013-07-24 13:02:32 +00:00
Robert Osfield
ee5a1b0a83 Fixed warning 2013-07-24 12:48:59 +00:00
Robert Osfield
085d3af14c From Rocco Martino, build fix for compiling against ffmpeg/trunk 2013-07-23 18:11:35 +00:00
Robert Osfield
ca3efe6bdc Added NOT ANDROID to force use of posix API when building for Android under Windows 2013-07-23 15:28:31 +00:00
Robert Osfield
c21b60b038 Added lazy setting of the UserDataContainer to avoid unncessarily create a UserDataContain when an empty description list is passed to Node::setDescriptions(..) 2013-07-23 10:24:28 +00:00
Robert Osfield
51075421d3 Fixed crash when open(..) returns an error. 2013-07-23 09:54:25 +00:00
Robert Osfield
fcca4032ef From Andreas Ekstrand, "Attached is a small modification of the Collada writer that protects from crashes due to valArray being NULL in some situations." 2013-07-22 13:31:32 +00:00
Robert Osfield
4a2e1534d5 From Christian Ruzicka, "with the current touch implementation on iOS the touches are not forwarded to parent views because the base implementation is not called. Also see the "Best Practices" in the iOS documentation for event handling:
http://developer.apple.com/library/ios/#documentation/EventHandling/Conceptual/EventHandlingiPhoneOS/multitouch_background/multitouch_background.html

"If you handle events in a subclass of any other UIKit responder class:
- You do not have to implement all of the event handling methods.
- In the methods you do implement, be sure to call the superclass implementation. For example, [super touchesBegan:touches withEvent:event]."

I added the missing lines and tested it with OSG 3.1.9 and iOS SDK 6.1."
2013-07-19 21:05:54 +00:00
Robert Osfield
f21a1dc9ad Added default setting of BIND_PER_VERTEX when applying Geometry::setTexCoordArray() 2013-07-19 20:59:09 +00:00
Robert Osfield
b3aa1bda1d Updated OpenThreads version to be in sync with OSG version 2013-07-19 17:00:24 +00:00
Robert Osfield
a270a7635e From Wang Rui, "A very small clerical error in the src/osgViewer/CMakeLists.txt makes MinGW/Cygwin builds fail. Now it is fixed and now OSG works well again with Cygwin. :-) The OSC plugin also needs a small fix to compile with Cygwin, as attached file src/osgPlugins/osc/osc/OscHostEndianness.h shows." 2013-07-19 06:39:06 +00:00
Robert Osfield
5255884fec Added a dirty() call to Image::setData(..) 2013-07-18 20:17:48 +00:00
Robert Osfield
62374833dd From Laurens Voerman, "some of my ive files now generate a warning:
Warning, can't assign attribute binding as no has been array assigned to set binding for.

I think those are ive's with bumpmaps, but I have not checked yet. The problem is in
OpenSceneGraph\src\osgPlugins\ive\Geometry.cpp
where the code tries to set Normalize and Binding for a missing Array.
I think that code can safely be skipped, considering the write function has a hardcoded write when the array is missing. (introduced in svn rev 13488)

modified file (OpenSceneGraph\src\osgPlugins\ive\Geometry.cpp) attached  in Zip"
2013-07-02 14:17:44 +00:00
Robert Osfield
330de18eba From Laurens Voerman, "Recent changes cause a few warnings in MSVC 2012
svn 13587 From David Callu, warning fixes and removal of spaces at end of lines.

this can be fixed by adding a space before the comment opening /*.
full modified file (openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h) attached in zip

Regards, Laurens.


openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(71): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(73): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(211): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)
openscenegraph\src\osgplugins\osg\BinaryStreamOperator.h(213): warning C4138: '*/' found outside of comment (OpenSceneGraph\src\osgPlugins\osg\ReaderWriterOSG2.cpp)"
2013-07-02 14:02:06 +00:00
Robert Osfield
8420b158c1 Restructed handling of the _currentShaderCompositionUniformList in State::apply() and State::apply(const StateSet*) so that it can be used even when shader composition isn't enabled. 2013-07-02 13:45:23 +00:00
Robert Osfield
095b64dc41 From Aurelien Albert, "Recently I had to integrate a client OpenGL library with OSG. For textures and other StateAttribute I've done that by subclassing osg::StateAttribute and this works well.
But for glPrograms, in order to get all osg's uniform management system to work, I had to subclass osg::program::PerContextProgram.

Here is a modified version of this class, which add some "virtual" method to allow easy subclassing."
2013-07-02 10:32:53 +00:00
Robert Osfield
d3c2896651 Added SceneView::Options enum enetries APPLY_GLOBAL_DEFAULTS and CLEAR_GLOBAL_STATESET to control whether a _globalStateSet->clear() and _globalStateSet->setGlobalDefaults() should be called.
osgViewer::Renderer doesn't use these enum settings so now no longer has a calls StateSet::clear() or StateSet::setGlobalDefaults() on the osg::Camera's StateSet.  Previously these were being
called and breaking the ability to attached state to Camera's StateSet.
2013-07-02 09:27:14 +00:00
Robert Osfield
0abbef71e1 From Pjotr Svetachov, "In a submission on June 27th a lot of new array types were added. This modified the osg::Array::Type enum. Because of this s_ArrayNames array in Array.cpp is now not in sync. This can lead to corrupt exports or crashes when writing .osg files because the change added new types in the middle of the enum instead of at the end.
Attached is a new Array.cpp to reflect the new array types."
2013-07-01 16:15:25 +00:00
Robert Osfield
0289b05cd5 Fixed debug build compile problem 2013-07-01 09:09:49 +00:00
Robert Osfield
a64b412885 Reverted the usage of OSG_UNUSED and OT_UNUSED as in hindsight these should never have been merged. Adding code to quieten
inappropriate warnings is a bad programming practice and does not desrve a place in the OSG code base.
2013-07-01 08:21:13 +00:00
Robert Osfield
e876e0bad3 From John Kaniarz, "This patch modifies ReaderWriterPNG.cpp to
1. Check the bit depth of the passed Image and return an error if not 8 or 16. (not fully featured, but still an improvement over hard coded 8bit for everything)
2. Endian swap 16bit image data when on a little endian architecture.
"
2013-06-28 15:44:04 +00:00
Robert Osfield
88a8423802 From Marcel Pursche, fixed checking of destination dimensions in osg::copyImage. 2013-06-28 14:38:45 +00:00
Robert Osfield
d4e1a8d6a3 From Lilin Xiong, "When writing proxyNode to ive file, we forget "LoadingExternalReferenceMode ". Add some code to fix this.
if (out->getVersion() >= VERSION_0045)
{
    out->writeInt(getLoadingExternalReferenceMode());
}

if (in->getVersion() >= VERSION_0045)
{
   setLoadExternalReferenceFiles( (osg::ProxyNode::LoadingExternalReferenceMode)in->readInt() );
}
"
2013-06-28 14:32:12 +00:00
Robert Osfield
2e41e3f656 From Gill Peacegood, "fix for a memory leak in the DelaunayConstraint class" 2013-06-28 14:21:43 +00:00
Robert Osfield
5db57cfa34 Fixed handling of DISPLAY=127.0.0.1:2 usage. 2013-06-28 14:07:31 +00:00
Robert Osfield
353b18b27b From Aurelien Albert, Added support for glPrimitiveRestartIndex.
"The idea of this new OpenGL feature is :

- set RestartIndex = "n"
- draw elements strip
  -> when the index is "n", the strip is "stopped" and restarted

It's very usefull for drawing tiles with a single strip and a "restart" at the end of each row.

The idea a an OSG StateAttribute is :

Usually we use to build geometry from code, because software modelers rarely support it (and 3d file formats doesn't support it) :

-RootNode <= "PrimitiveRestartIndex=0"     // So now, we know that our restart index is 0 for all drawables under this node
|
- Drawable 1 : triangles => as usual
|
- Drawable 2 : triangles strip => as usual
|
- Drawable 3 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 4 : triangles strip + "GL_PRIMITIVE_RESTART" mode = ON => use the restart index
|
- Drawable 5 : triangles strip => as usual


With a StateAttribute, it's easy for the developper to say "0 will be my restart index for all this object" and then activate the mode only on some nodes.

The main problem is if you set and restart index value which is not included in the vertex array (for exemple set restart index = 100 but you have only 50 vertex). There is no problem with OpenGL, but some OSG algorithms will try to access the vertex[100] and will segfault.

To solve this, I think there is two ways :

1/ add restart index in osg::PrimitiveSet and use this value in all algorithms. It's a lot of work, maybe dangerous, and it concern only a few situations : developpers who use this extension should be aware of advanced OpenGL (and OSG) data management

2/ use a StateAttribute, and choose a "correct" restart index. In my applications, I always use "0" as a restart index and duplicate the first vertex (vertex[0] = vertex[1]). So there is no difference for OpenGL and all OSG algorithms works properly.
"
2013-06-28 13:43:46 +00:00
Robert Osfield
b2c838033d Added handling of an odd number rows in the capsule rendering and primitive calculation. 2013-06-28 12:45:39 +00:00
Robert Osfield
097aedf23c From David Callu, warning fixes and removal of spaces at end of lines. 2013-06-28 12:00:43 +00:00
Robert Osfield
db1f2c5eb1 From David Callu, added support for glVertexAttribLPointer and glVertexAttribIPointer, utilized via osg::Array::setPreserveDataType(true); 2013-06-28 10:51:22 +00:00
Robert Osfield
4fd6566e00 From David Callu, serializer support for new Vec* and Vec*Array classes 2013-06-28 08:57:42 +00:00
Robert Osfield
f2c1a7597c 2013-06-28 08:11:46 +00:00
Robert Osfield
775c1443eb From David Callu, "Added Vec3ub, Vec3us, Vec4us, Vec2ub and Vec2us classes" 2013-06-27 17:37:03 +00:00
Robert Osfield
9f13e2fcb9 From Lionel Lagarde, "Support for paging and shared PBO"
"The attached file contains:
- a per-context read counter in GLBufferObject::BufferEntry
- a global client counter in BufferData
- the glue between Texture* and Image client counter
"
2013-06-27 16:44:32 +00:00
Robert Osfield
57947ea75c From Aurelien Albert, added passing on of the gl array normalize to OpenGL when uses vertex attribute aliasing. 2013-06-27 15:18:38 +00:00
Robert Osfield
90ceb88c12 Replaced deprecatated osg::Geometry::get*Binding() calls. 2013-06-27 14:46:16 +00:00
Robert Osfield
dfc1a899db Added Geometry::containsDeprecatedData() / fixDeprecatedData() 2013-06-27 13:37:26 +00:00
Robert Osfield
092dd93be8 Removed deprecated usage of osg::Geometry::get*Binding() 2013-06-27 10:58:26 +00:00
Robert Osfield
c1ebc3ac0c Replaced deprecated osg::Geometry::set*Binding() usage 2013-06-27 08:44:15 +00:00
Robert Osfield
38bb71460a Replaced deprecated Geometry::set*Binding() 2013-06-27 08:30:51 +00:00
Robert Osfield
8e65ab7e45 Replaced deprecated Geometry::set*Binding() usage 2013-06-26 18:06:09 +00:00
Robert Osfield
5a25a93bdd Removed deprecated Geometry::set*Binding() usage 2013-06-26 17:58:57 +00:00
Robert Osfield
7ee05a345a Replaced deprecated osg::Geometry::set*Binding() usage 2013-06-26 17:45:19 +00:00
Robert Osfield
55416d83b3 Replaced deprecated osg::Geometry::set*Binding() calls. 2013-06-26 17:44:30 +00:00
Robert Osfield
a459033eff From Sebastian Messerschmidt, "I've taken some time and refactored some places where the old set*Binding were used." 2013-06-26 16:16:23 +00:00
Robert Osfield
bead0740f2 From Aurelien Albert, "This submission allow the user to specify how to setup VertexAttributeAliasing.
I think this is necessary on OpenGL 3.2+ since this is no more "default" locations in the OpenGL specs.

The default behaviour stay the same.

There is a few new methods on osg::State :

- resetVertexAttributeAlias : reset all vertex alias to osg's default ones
- set**Alias : set a vertex attribute alias configuration
- setAttributeBindingList : set the attribute binding list (allow to specify an empty list if you're using "layout" qualifier in glsl code to specify the bindings. This save some CPU operations)"
2013-06-26 13:00:12 +00:00
Robert Osfield
ea2cbee347 Removed spaces from end of line 2013-06-26 12:33:40 +00:00
Robert Osfield
71c1fc87bb Fixed bug in TemplateTargetAttributeDispatch that was causing a crash with the osgsimplegl3 example 2013-06-26 12:33:14 +00:00
Robert Osfield
6377e37e88 From Pjotr Svetachov and Robert Osfield, "the index mesh and vertex pre-transform optimizers can rearrange or change the size of arrays assigned to a geometry. This leads to crashes or corrupt geometry when using shared arrays.
Attached a fix that duplicates shared geometry arrays."
2013-06-26 09:04:20 +00:00
Robert Osfield
b70dfd40aa Removed Geometry::fixDeprecatedData() as it won't work on const Geometry 2013-06-26 08:53:56 +00:00
Robert Osfield
36f48f2227 From Mathias Froehlich, "The attached file replaces the deprecated geometry use in osgSim.
The per primitive use is changed to full per vertex arrays."
2013-06-26 07:08:26 +00:00
Robert Osfield
1793466442 With assistance from Sukender, moved the depreacted osg::Geometry vertex indices and AttributeBinding definitions out into a separated namespace/class so to use
deprecated features you should now use deprecated_osg::Geometry in place of osg::Geometry.
2013-06-25 16:10:24 +00:00
Robert Osfield
ba9ccd91a1 From Cedric Pinson, "I fixed a little issue with the lightwave scene loader. On the version 5 there are id on the command LoadObjectLayer in the scene file and of this version the current code use this field as a part of the filename, and it fails because the file is not found.
I just added a field version_ to read it at the beginning and added extra code to check it and read the extra field if needed and read the good filename"
2013-06-24 12:51:02 +00:00
Robert Osfield
84d7d9a056 From Christian Ruzicka, "when MSAA is activated on iOS, the stencil attachment is not added (Stencil buffer is not working at all). Attached are the needed changes to make MSAA + stencil working on iOS.
Tested with OSG 3.1.7 and iOS SDK 6.1."
2013-06-24 12:31:48 +00:00
Robert Osfield
ba2242decb From Mourad Boufarguine, "Attached is a fix for the ply reader to use the output of osgDB::findDataFile.
"
2013-06-24 11:40:16 +00:00
Robert Osfield
6331a54a68 From Luc Frauciel, "You'll find attached a modification of DXWriter to support Material color:
If a material is present, the diffuse color is affected to current layer."
2013-06-24 11:39:26 +00:00
Robert Osfield
0896bd17bd From Lars Nillson, "The change in this submission is to take care of the setting given by a call to
setMaximumNumOfObjectsToCompilePerFrame(…).


Sometimes if you give a low number, more than the expected number of objects are compiled."
2013-06-24 11:14:13 +00:00
Robert Osfield
ca2688b046 Convert usage to use const versions of containers 2013-06-24 11:03:59 +00:00
Robert Osfield
261db64a9e From Farshid Lashkari, "I've attached a small patch that extends the Image::readImageFromCurrentTexture method to support more depth texture pixel formats (16, 24, 32, 32F). In order to compile, I moved some depth pixel format definitions from FrameBufferObject to Image.
"
2013-06-24 09:51:30 +00:00
Robert Osfield
70ae69648d From Nick Black, "Hey there! avcodec_open() has been deprecated for some time, and indeed has
been removed in the most recent versions of libavcodec/ffmpeg. You're
already using avcodec_open2() elsewhere, but one appears to have been
missed. The change is trivial:

[skynet](0) $ svn diff
Index: src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp
===================================================================
--- src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp        (revision 13355)
+++ src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp        (working copy)
@@ -109,7 +109,7 @@
         //    m_context->flags |= CODEC_FLAG_TRUNCATED;

         // Open codec
-        if (avcodec_open(m_context, p_codec) < 0)
+        if (avcodec_open2(m_context, p_codec, NULL) < 0)
             throw std::runtime_error("avcodec_open() failed");
     }

[skynet](0) $

I've applied similar changes this year to many other packages, including
cheese, blender, linphone, ad nauseam. It's been tested by verifying that
with my patch, OSG builds against the newest libavcodec and ffmpeg, whereas
otherwise it does not.

The modified src/osgPlugins/ffmpeg/FFmpegDecoderAudio.cpp is attached. It
originates in svn trunk revision 13355. Thanks!"
2013-06-24 09:12:58 +00:00
Robert Osfield
48020eed9e Introduced typedef's to make the code more readble and maintanable 2013-06-24 09:02:32 +00:00
Robert Osfield
4044fd5a74 From Wang Rui, "The file attached includes two new features for the serialization IO functionality. First, custom serializer version control should work now, just by defining a new REGISTER_CUSTOM_OBJECT_WRAPPER macro. For example:
// A custom class
namespace CustomDomain {

class MyGroup : public osg::Group
{
public:
    META_Node( CustomDomain, MyGroup );

    void setMyName( const std::string& n );
    const std::string& getMyName() const;

    void setMyID( int id );
    int getMyID() const;

    ...
};

}

// The serialization wrapper using a custom domain name
REGISTER_CUSTOM_OBJECT_WRAPPER( MyDomain,
                                CustomDomain_MyGroup,
                                new CustomDomain::MyGroup,
                                CustomDomain::MyGroup,
                                "osg::Object osg::Node osg::Group CustomDomain::MyGroup" )
{
    ADD_STRING_SERIALIZER( MyName, std::string() );
    {
        UPDATE_TO_VERSION_SCOPED( 1 );  // Updated for a new domain version
        ADD_INT_SERIALIZER( MyID, 0 );
    }
}

Save the class instance as follows:
osgDB::writeNodeFile( *myGroup, "serializer_test.osgt", new osgDB::Options("CustomDomains=MyDomain:1") );

The output file will include the domain version definition and all the class data, and can be read back. We can also force setting the domain version by the CustomDomains option while reading the saved files. If we save the class instance without any options, MyID will be ignored because the default domain version is 0.

This may help third-party libraries like osgEarth to maintain their own serializers without regarding to the OSG soversion changes.

Another feature added is a more robust binary format, which in fact adds a size-offset at each block's beginning. When there are problems or unsupported data types while reading, we can now directly jump to the block end indicated by the offset value. So a .osgb file will automatically ignore bad data and read remains as normal (at present it will fail at all). This feature will not break the backward compatibility, and can be disabled by setting "RobustBinaryFormat=false" while writing out.

Hope these changes can work smoothly with present and future community projects. Maybe we should also consider have an osgserializer example to test and demonstrate all things we can do now."
2013-06-24 08:48:55 +00:00
Robert Osfield
b3f0479118 From Wang Rui, "Sorry for my very slow response because of some personal issues. I found that new Geometry serializers can't work with old .osgb files. The modified FastPathHint serializer doesn't correctly read from the stream and thus jumbles following inputs. The file attached can be placed in osgWrappers/serializers/osg to fix that problem.
"
2013-06-24 08:22:50 +00:00
Robert Osfield
340a47dc66 From Wang Rui, "The osgdb_ffmpeg plugin may not work with latest ffmpeg windows sdk and will say "The procedure entry point xxx could not be located in xxx.dll" instead. The following link describes the reason (maybe a certain optimization problem of the VS compiler):
http://forum.videolan.org/viewtopic.php?f=32&t=98097

After adding the /OPT:NOREF, the problem has gone.

"
2013-06-24 08:19:34 +00:00
Robert Osfield
db4b7584fb From Farshid Lashkari, "In many game engines it is common to set the W component of the tangent vector to -1 if the UVs are mirrored and 1 if not. I've updated the osgUtil::TangentSpaceGenerator class to do the same." 2013-06-24 08:18:08 +00:00
Robert Osfield
df3626be27 Fixed author name error introduced by xxdiff 2013-06-21 14:37:35 +00:00
Robert Osfield
59d53b40a1 Removed unneccessary handling of BIND_PER_PRIMITIVE on output code 2013-06-21 14:17:42 +00:00
Robert Osfield
9d9543ca0a From Pjotr Svetachov, introduced use of osg::observer_ptr<osg::Camera> in place of osg::Camera* 2013-06-21 13:59:18 +00:00
Robert Osfield
da134aa8ed From Stephan Huber, "attached you'll find the missing readObject-implementations for the imageio-plugin as suggested by Remo Eichenberger." 2013-06-21 13:41:03 +00:00
Robert Osfield
cb09fff797 From Laurens Voerman, build fix 2013-06-21 12:10:44 +00:00
Robert Osfield
18d6d298bf Build fixes for new osg::Geometry 2013-06-21 10:59:03 +00:00