Commit Graph

291 Commits

Author SHA1 Message Date
Thomas Hogarth
76fe572934 Added conditionals for GLES3, added correct gl headers for GLES3 on iOS and Android to GL.in 2017-03-20 18:33:08 +00:00
Robert Osfield
b5c4f461bc Fixed unitialized variable access to premature calling of computeMatrix(). 2017-01-04 12:55:15 +00:00
Robert Osfield
52fe86dcc9 From Hartwig Wiesmann, "ScalarsToColors returns a wrong color in case a value larger max is passed to getColor" 2016-12-23 17:16:16 +00:00
Robert Osfield
66873b8c6c Fixed build errors when OSG_USE_REF_PTR_IMPLICIT_OUTPUT_CONVERSION to OFF 2016-10-11 11:29:29 +01:00
Robert Osfield
c637010c9d Refactored ImpostorSprite so that it no longer uses GLBeginEndAdapter 2016-10-11 11:29:29 +01:00
Robert Osfield
037e8f24c6 Removed commented out debug message 2016-10-11 11:29:29 +01:00
Robert Osfield
7c432fbe11 Refactored osgSim::SphereSegment so that it no longer uses GLBeginEndAdapter 2016-10-11 11:29:29 +01:00
Robert Osfield
7d83d735ad Implemented a different approach to vertex array object support to enable creation of a single global vertex array object as well as provide individual vertex array objects per Drawable when required. 2016-10-11 11:29:29 +01:00
Robert Osfield
20d1e4c9c5 Added initializer 2016-06-23 06:56:22 +01:00
Robert Osfield
af11e35fcb Fixed invalidated iterator bug pick up by Coverity. 2016-06-10 12:44:26 +01:00
Robert Osfield
1cc0f31e30 Fixed shadows warnings 2016-05-25 11:30:49 +01:00
Robert Osfield
8fc287c1b7 Added asUpdate/Cull/EventVisitor and asCamera/asDrawable to osg::Object and usage of these within the code base to avoid dynamic_cast<> usage. 2016-01-20 17:49:10 +00:00
Robert Osfield
dd996a3289 Introduced CMake option OSG_PROVIDE_READFILE option that defaults to ON, but when switched to OFF disables the building of the osgDB::read*File() methods,
forcing users to use osgDB::readRef*File() methods.  The later is preferable as it closes a potential threading bug when using paging databases in conjunction
with the osgDB::Registry Object Cache.  This threading bug occurs when one thread gets an object from the Cache via an osgDB::read*File() call where only
a pointer to the object is passed back, so taking a reference to the object is delayed till it gets reassigned to a ref_ptr<>, but at the same time another
thread calls a flush of the Object Cache deleting this object as it's referenceCount is now zero.  Using osgDB::readREf*File() makes sure the a ref_ptr<> is
passed back and the referenceCount never goes to zero.

To ensure the OSG builds when OSG_PROVIDE_READFILE is to OFF the many cases of osgDB::read*File() usage had to be replaced with a ref_ptr<> osgDB::readRef*File()
usage.  The avoid this change causing lots of other client code to be rewritten to handle the use of ref_ptr<> in place of C pointer I introduced a serious of
templte methods in various class to adapt ref_ptr<> to the underly C pointer to be passed to old OSG API's, example of this is found in include/osg/Group:

    bool addChild(Node* child); // old method which can only be used with a Node*

    tempalte<class T> bool addChild(const osg::ref_ptr<T>& child) { return addChild(child.get()); } // adapter template method

These changes together cover 149 modified files, so it's a large submission. This extent of changes are warrent to make use of the Object Cache
and multi-threaded loaded more robust.



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15164 16af8721-9629-0410-8352-f15c8da7e697
2015-10-22 13:42:19 +00:00
Robert Osfield
2208303496 Warning fixes for Clang-3.6
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@15016 16af8721-9629-0410-8352-f15c8da7e697
2015-07-23 11:11:58 +00:00
Robert Osfield
ba9dfb2ff6 From Albert Luaces, typo fixes.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14883 16af8721-9629-0410-8352-f15c8da7e697
2015-06-01 13:40:20 +00:00
Robert Osfield
87122ca369 Fixed typo of SEPARATE enums
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14833 16af8721-9629-0410-8352-f15c8da7e697
2015-04-13 11:48:28 +00:00
Robert Osfield
1db6def2c4 From Jamie Robertson, "I've been using osgSim::ScalarBar to display fixed range color values (e.g. red from 1-2, green from 3-4 etc), by setting the _numColors the same as the number of actual colors in the ColorRange.
Currently if you do this you get strange looking results as the colors are calculated for values in the centre of each color step, so if your steps are large, the colors are interpolated sigificantly (see screen grab of red, green and blue colors for illustration).

I've attached a fix which just uses the original color values whenever _numColors equals the number of actual defined colors in the ColorRange. I doubt anyone would want interpolated colors in these circumstances."



git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14720 16af8721-9629-0410-8352-f15c8da7e697
2015-02-25 19:31:20 +00:00
Robert Osfield
3dde165f14 Refactor osg::Geode to subclass from osg::Group and reuse the NodeList children container 2014-06-03 09:23:24 +00:00
Robert Osfield
4174d72a52 2014-05-14 10:19:43 +00:00
Robert Osfield
f5261b9877 Fixed type error 2014-04-28 11:53:58 +00:00
Robert Osfield
ec658b115c Fixed reference invalidation bug. 2014-04-24 10:38:58 +00:00
Robert Osfield
f7e6f0092c From Kristofer Tingdahl, "the vertical bar is upside down, and hence not as the documentation says it should be. This is corrected with this patch"
From Robert Osfield, changed the example so that the vertical and horizon scalar bars are rotated to the XZ plane so you can see them with the default viewer's camera orientation.
Tweaked the positioning of title text of vertic scalar bar to avoid overlap of text.
2014-01-28 11:01:28 +00:00
Robert Osfield
8a334e724b From Kristofer, "The osgSim::ScalarBar has a problem in that if the scalarbar has a color in one end that co-incides with the background color, one cannot see where the scalarbar ends. With this patch, we add a line around the perimiter of the bar to mark it.
Secondly, we thought the text-annotation missed ticks that mark out precisely where on the bar the texts relate to, so we added that as well."
2014-01-24 16:19:38 +00:00
Robert Osfield
8e65ab7e45 Replaced deprecated Geometry::set*Binding() usage 2013-06-26 18:06:09 +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
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
df075ef9bb Cleaned up usage of BIND_PER_PRIMITIVE where possible. 2013-06-19 16:24:59 +00:00
Robert Osfield
5d7049dd9c From Chris Hanson, " Adds missing copy for _bbox member variable to copy constructor:
LightPointNode::LightPointNode(const LightPointNode& lpn,const osg::CopyOp& copyop):
    osg::Node(lpn,copyop),
    _bbox(lpn._bbox),
    _lightPointList(lpn._lightPointList),
    _minPixelSize(lpn._minPixelSize),
    _maxPixelSize(lpn._maxPixelSize),
    _maxVisibleDistance2(lpn._maxVisibleDistance2),
    _lightSystem(lpn._lightSystem),
    _pointSprites(lpn._pointSprites)
{
}


  Lacking this causes _bbox to be uninitialized after LOD changes when paged databases refer to shared subgraphs.

"
2013-02-22 17:42:47 +00:00
Robert Osfield
14a563dc9f Ran script to remove trailing spaces and tabs 2012-03-21 17:36:20 +00:00
Robert Osfield
f68c2246fc From Martin Innus, fixed erroneous change of INTEGER to UNKNOWN, reverting back to INTEGER. 2011-06-24 13:35:20 +00:00
Robert Osfield
0a48e99a25 From Ulrich Hertlein, "While we're on osgSim/ShapeAttribute, here's a fix that fixes the 'UNKNOW' typo and some
doxygen"
2011-06-24 08:32:25 +00:00
Robert Osfield
74dab1fe8d Fixed Coverity reported issue.
CID 11812: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _lastFrameUsed is not initialized in this constructor nor in any functions that it calls.
Non-static class member _s is not initialized in this constructor nor in any functions that it calls.
Non-static class member _t is not initialized in this constructor nor in any functions that it calls.
2011-05-09 10:54:50 +00:00
Robert Osfield
07a29e39e0 Fixed Coverity reported issue.
CID 11813: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _endian is not initialized in this constructor nor in any functions that it calls.
2011-05-09 10:54:10 +00:00
Robert Osfield
01b80e4f66 Fixed Coverity reported issue.
CID 11814: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _updateCamera is not initialized in this constructor nor in any functions that it calls.
2011-05-09 10:53:38 +00:00
Robert Osfield
5b0ab95e41 Fixed 6 Coverity reported issues.
CID 11820: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _azAngle is not initialized in this constructor nor in any functions that it calls.
Non-static class member _elevAngle is not initialized in this constructor nor in any functions that it calls.

CID 11819: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _BoundaryAngle is not initialized in this constructor nor in any functions that it calls.
Non-static class member _planeOrientation is not initialized in this constructor nor in any functions that it calls.

CID 11818: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _BoundaryAngle is not initialized in this constructor nor in any functions that it calls.
Non-static class member _planeOrientation is not initialized in this constructor nor in any functions that it calls.

CID 11817: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _distance is not initialized in this constructor nor in any functions that it calls.

CID 11817: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _distance is not initialized in this constructor nor in any functions that it calls.

CID 11816: Uninitialized scalar field (UNINIT_CTOR)
Non-static class member _leftRightSurfaces is not initialized in this constructor nor in any functions that it calls.
2011-05-09 10:52:34 +00:00
Robert Osfield
42b709a9f4 From Rafa Gaitan, "I have added the macro SETUP_LIBRARY, similar to SETUP_PLUGIN or
SETUP_EXE, in order to have a unique entry point to build the
libraries. With this changes the android integration will be less
painful (currently is a big IF(ANDROID) for each CMakeLists.txt) and
more maintainable in the future. I hope next submissions will be for
supporting android from my colleague Jorge.
"
2011-03-08 13:51:13 +00:00
Robert Osfield
410b4fd109 Converted FrameStamp::g/setFrameNumber from int to uint 2010-12-22 20:11:05 +00:00
Robert Osfield
b9ae28d344 From Eduardo Poyart, OSG patch: made it read ancillary IndexedStrings into MultiSwitch 2010-11-26 17:35:06 +00:00
Robert Osfield
6fe084df3b Introduced the use of atan2 in place of asin/acos for reliability and simplicity 2010-06-14 16:27:35 +00:00
Robert Osfield
bcbfed5c8b Converted osg::notify to OSG_INFO etc. 2010-05-28 16:09:29 +00:00
Robert Osfield
4a0c21a5fc From Wang Rui, serializers for osgSim and osgVolume 2010-05-18 11:00:06 +00:00
Robert Osfield
86f491e649 Replaced use of unsigned int/enum mask combinations with int/enum mask combinations to avoid the need for casting enums to unsigned ints,
and to avoid associated warnings.

Update wrappers to reflect these changes.
2010-03-05 12:55:08 +00:00
Robert Osfield
41ba8ce585 From Christian Ehrlicher, "during profiling my program I found out that there's a lot of memory
(de)allocation going on in OverlayNode::cut().

So instead creating inner-loop variables 'distances' and 'newVertices'
every time, I moved the creation out of the loop and just do a clear() +
reserve() inside the loop. This allows std::vector<> to reuse the old
memory instead allocating new when the new size <= oldsize."
2009-11-27 16:47:38 +00:00
Robert Osfield
b7cabac990 From Mathias Froechlich, "Attached the collected fixes I needed to compile with all of them.
Most notable the __hpux define stuff. The __hpux__ variant seems to be not
defined which resulted in a compile error at this time. Consequently I have
replaced all occurances of __hpux__ with __hpux. And huge surprise: now osg
plugins are found and loaded correctly ...
The next notable one is the MSVC_IDE fix which makes the nmake Makefiles cmake
generator target behave like the ide one. Showed up because I started to do
scripted builds with nmake instead of devenv...
The rest is the usual bunch of stuff that just happens during normal
coding ..."
2009-11-18 12:15:29 +00:00
Robert Osfield
72ff1f40f9 From Paul Martz, changes for compiling against OpenGL 3.x 2009-11-03 16:34:54 +00:00
Robert Osfield
d17d7159a1 Ported osgUtil, osgDB, osgGA, NodeKits and plugins to compile against OpenGL ES 1.1 and OpenGL ES 2.0. 2009-10-28 20:31:57 +00:00
Robert Osfield
04ddb2dee5 Converted all glBegin/glEnd code across to using osg::GLBeginEndAdapter 2009-10-21 16:16:31 +00:00
Robert Osfield
773ae51a45 From Chris Hanson, typo and comment clean ups 2009-07-24 14:45:44 +00:00
Robert Osfield
24a8b2acd7 From Lionel Lagarde, "this correction makes the intensity interpolated in the correct direction when the angle is between _cosFadeAngle and _cosAngle." 2009-06-08 11:12:34 +00:00