Commit Graph

37 Commits

Author SHA1 Message Date
Robert Osfield
709194c88c Replaced osgUtil::IntersectVisitor usage with osgUtil::InteresectionVisitor 2018-04-20 14:32:34 +01: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
4b9aa1fd24 Replaced deprecated osg::Geometry::set*Binding() usage. 2013-06-27 09:54:12 +00:00
Robert Osfield
bab251fc59 Cleaned up BIND_PER_PRIMITIVE and array indice usage 2013-06-04 10:06:19 +00:00
Robert Osfield
668d351765 Introduced new scheme for handling mouse events with osgViewer. The new scheme enables robust event handling even when using distortion correction render to texture Cameras. 2013-05-03 19:26:27 +00:00
Robert Osfield
d18250da59 Replaced .osg with .osgt file usage 2011-06-14 16:54:20 +00:00
Robert Osfield
c80c7dd5b9 From Chris Denham, added transform to cube to test picking fixes 2008-11-06 13:36:25 +00:00
Robert Osfield
0b451491b0 From Chris Denham, changed nested Camera intersection test so that it requires the command line --relative-camera-scene to enable it 2008-10-27 19:59:05 +00:00
Robert Osfield
ff74744556 From Chris Denham, default scene that tests the use of in scene graph Camera which has a RELATIVE_RF ReferenceFrame. 2008-10-27 16:16:28 +00:00
Robert Osfield
15e5bdbcae Added range of camera manipulators and a center of screen test intersection that
is insticated by pressing 'c' key
2008-07-09 19:28:00 +00:00
Robert Osfield
d8f674a59d From Jean-Sebastien Guay and Robert Osfield, added optional --CompositeViewer path into osgpick to illustrate how to do picking in both viewers and as unit test for picking. 2008-03-04 14:19:03 +00:00
Robert Osfield
cc0f1cb0fe From Martin Lavery and Robert Osfield, Updated examples to use a variation of the MIT License 2007-06-12 14:20:16 +00:00
Robert Osfield
ce0f30cfcb From Martin Lavery and Robert Osfield, added fallbacks for when now command line args are provided. 2007-06-08 15:37:20 +00:00
Robert Osfield
5be86601bb Removed old GNUmakefile.inst files 2007-04-10 13:58:18 +00:00
Robert Osfield
2e6ee4bb39 Removed old gmake and VisualStudio build files 2007-04-10 13:10:25 +00:00
Robert Osfield
d9a94f7890 Moved the TARGET_NAME setting into the SETUP_APPLICATION/EXAMPLE macro 2007-03-19 17:18:59 +00:00
Robert Osfield
da64127539 Ran dos2unix on CMakeLists.txt files. 2007-03-19 13:26:34 +00:00
Robert Osfield
be3f61c49f From Luigi Calori, move to using local CMakeLists.txt files and explicit file lists.
From Robert Osfield, small ammendments of the above to seperate example and application installs, and fix the osgPlugins install directory.
2007-03-19 12:30:26 +00:00
Robert Osfield
953899d0e2 Set the DataVariance of updating text to DYNAMIC 2007-02-14 12:42:10 +00:00
Robert Osfield
c4279bd5f1 Ported following examples to osgViewer:
osgparticleeffects
osgphotoalbum
osgpick
osgpoints
osgpointsprite
osgprecipitation
osgprerender
osgprerendercubemap
osgreflect
osgscalarbar
osgscribe
osgsequence
osgplanets
2007-01-10 13:52:22 +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
41a4aa1548 Added viewer.cleanup_frame() to all examples. 2006-08-02 19:55:03 +00:00
Robert Osfield
f1c2694c17 Updated copyright years. 2006-07-18 15:21:48 +00:00
Robert Osfield
061976f4d4 Fixed typo in text string. 2005-12-16 14:53:51 +00:00
Robert Osfield
b0df518d11 Added handling of CameraNode into PickVisitor in src/osgProducer/Viewer.cpp. This
is unlikely to be the final solution, but does at least fix part of the problem of handling
picking HUD's underneath CameraNodes.
2005-11-02 15:23:54 +00:00
Robert Osfield
21ea5a55a8 Added #include <osg/io_utils> 2005-04-08 09:51:56 +00:00
Robert Osfield
b70ff91eaf Changed ABSOLUTE and RELATIVE to ABSOLUTE_RF and RELATIVE_RF to avoid stooppid Win32 #define 2004-10-24 20:04:00 +00:00
Robert Osfield
6821a80e14 Changed the ReferenceFrame enums to be RELEATIVE and ABSOLUTE, and
deprecated the RELATIVE_TO_ABSOLUTE and RELATIVE_TO_PARENTS.
2004-10-22 19:26:45 +00:00
Robert Osfield
8d5aa5644d Added X_INC into the Make/makedefs and changed the *GNUmakefile* to use it. 2003-08-18 10:58:30 +00:00
Don BURNS
49a93076c1 Removed references to PRODUCER_INCLUDE_DIR and PRODUCER_LIB_DIR in the
local makefiles.

Small change in txp loader for sun build
2003-07-25 23:49:03 +00:00
Robert Osfield
89b1365b2b Added support for gather information on which vertices have been intersected with. 2003-04-25 13:47:33 +00:00
Robert Osfield
904aceec22 Added convinence methods to osgProducer::Viewer:
/** compute, from normalized mouse coords, for sepecified Camera, the pixel coords relative to that Camera's RenderSurface.*/
        bool computePixelCoords(float x,float y,unsigned int cameraNum,float& pixel_x,float& pixel_y);

        /** compute, from normalized mouse coords, for sepecified Camera, the near and far points in worlds coords.*/
        bool computeNearFar(float x,float y,unsigned int cameraNum,osg::Vec3& near, osg::Vec3& far);

        /** compute, from normalized mouse coords, for sepecified Camera, intersections with the scene.*/
        bool computeIntersections(float x,float y,unsigned int cameraNum,osgUtil::IntersectVisitor::HitList& hits);

        /** compute, from normalized mouse coords, for all Cameras, intersections with the scene.*/
        bool computeIntersections(float x,float y,osgUtil::IntersectVisitor::HitList& hits);
2003-04-16 14:17:49 +00:00
Robert Osfield
f9eb43083a Changed OsgSceneHandler so it re-uses osgUtil::SceneView project and modelview
matrices.

Changed the osgpick demo so that it uses the OsgSceneHandler's projection and
modelview matrices where possible.
2003-04-16 09:22:33 +00:00
Robert Osfield
fc4a2ab191 Added support for multiple cameras into osgpick. 2003-04-15 20:54:10 +00:00
Robert Osfield
0036018507 Added -I/usr/X11R6/include to osgProducer and all the examples GNUMakefiles.
From Bob, mods to GNUMakefile and Make/makedefs for the extra includes for
freetype.
2003-04-14 19:39:22 +00:00
Robert Osfield
5df7118d6d Updates to the osgpick code.
Updates to osgGA::CameraManipulors.
2003-04-14 15:44:30 +00:00
Robert Osfield
026dc2cbb7 Added Geoff Michel's osgpick and osgUtil::PickVisitor code. 2003-04-13 13:26:41 +00:00