Commit Graph

29 Commits

Author SHA1 Message Date
Robert Osfield
1219a6d3bf Added more osg::Object::as*() methods and usage of these through the code base to avoid use of dynamic_cast<> when using UpdateVisitor/CullVisitor/EventVIisitor etc. 2016-01-20 15:13:19 +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
70b5297575 From Jannik Heller, typo fixes
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14826 16af8721-9629-0410-8352-f15c8da7e697
2015-04-07 18:01:12 +00:00
Robert Osfield
03fc0c3662 Added support for intesecting Drawable that are attached directly to the scene graph without an osg::Geode 2014-05-15 16:30:17 +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
83c396b13b From Jan Peciva, RayIntersector implementation 2013-10-03 08:45:57 +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
90703f99ee Added missing initializer for _epsilon 2013-08-01 17:38:34 +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
5aa1234fa4 Fixed usage of META_NodeVisitor so it doesn't include "" 2013-01-24 18:48:34 +00:00
Robert Osfield
7cd74f0282 From Farshid Lashkari, "Another update. I added a LIMIT_NEAREST enum which implements your previous suggestion of rejecting bounding volumes further from the nearest existing intersection. I only implemented this for LineSegmentIntersector. I'd appreciate it if you could double check the math I added to LineSegmentIntersector::intersects() for checking if the bounding sphere is further away. The results of this are promising. I'm getting noticeable performance increase for line intersections with scenes containing many drawables.
"
2011-03-14 10:07:15 +00:00
Robert Osfield
f7718d2b7b From Farshid Lashkari, removal of redundent spaces at the end of lines. 2011-03-11 17:20:24 +00:00
Robert Osfield
8a6e04b84d Introduce NodeVisitor::className and libraryName() 2008-12-17 12:13:15 +00:00
Robert Osfield
bcbd50af39 Implemented a reference eye point and associated methods in support of intersecting billboards 2008-08-14 14:22:39 +00:00
Robert Osfield
c41ca3d6a0 Introduced code for doing dummy test traversals - used for benchmarking KdTree code. 2008-07-09 19:40:10 +00:00
Robert Osfield
ee9b23f670 Fixed set method 2008-07-08 18:02:09 +00:00
Robert Osfield
2851429333 Added optional control of whether to use KdTrees for intersections 2008-07-08 17:35:10 +00:00
Robert Osfield
f4afa427a7 From Roland Smeenk, "Attached you will find a large set of small typo fixes (mainly in the comments)." 2007-12-10 17:30:18 +00:00
Robert Osfield
191e12c4b1 Added const get*Matrix() methods 2007-06-08 09:17:42 +00:00
Robert Osfield
a2e79f6a38 Moved osgUtil::PolytopeIntersector, osgUtil::PlaneIntersector and osgUtil::LineSegmentIntersector out from include/osgUtil/IntersecionVisitor into their own seperate files. 2006-11-28 16:30:38 +00:00
Robert Osfield
05bffbe9c4 Added beginnings of osgUtil::PlaneIntersector and osgSim::ElevationSlice 2006-11-27 20:25:36 +00:00
Robert Osfield
fd2ffeb310 Renamed osg::CameraNode to osg::Camera, cleaned up osg::View.
Added beginnings of new osgViewer::Scene,View,Viewer,CompositeViewer and GraphicsWindowProxy files.
2006-11-27 14:52:07 +00:00
Robert Osfield
06cca16a2a Added convinience constructors to help support picking with the new osgUtil::Intersector classes. 2006-11-02 17:05:46 +00:00
Robert Osfield
f9fb99dc43 Added prelimnary work on PolytopeIntersector. 2006-11-02 12:17:06 +00:00
Robert Osfield
15f7abe100 Improved handling of projected coords in new intersection classes 2006-11-01 17:18:45 +00:00
Robert Osfield
75169ad16f Added support for osgUtil::Intersectors being in WINDOW, PROJECTION, VIEW or MODEL coordinates 2006-11-01 14:41:32 +00:00
Robert Osfield
16c238fc60 Added osgSim::LineOfSight and osgSim::HeightAboveTerrain classes 2006-10-30 20:29:06 +00:00
Robert Osfield
358b96e953 Added osgUtil::IntersectorGroup to handle groups of osgUtil::Intersectors 2006-10-27 15:11:17 +00:00
Robert Osfield
ce3929fd5f Added beginings of new osgUtil::IntersectionVisitor and osgintersection class 2006-10-26 16:03:17 +00:00