Openscenegraph Reference Manual
Total Page:16
File Type:pdf, Size:1020Kb
OpenSceneGraph Reference Manual v2.2 Editors Bob Kuehne Paul Martz Many of the designations used by manufacturers and sellers to distinguish their products are claimed as trademarks. Where those designations appear in this book, and the authors were aware of a trademark claim, the designations have been printed with initial capital letters or in all capitals. The authors and publishers have taken care in the preparation of this book, but make no expressed or implied warranty of any kind and assume no responsibility for errors or omissions. No liability is assumed for incidental or consequential damages in connection with or arising out of the use of the information or programs contained herein. OpenSceneGraph Reference Manual v2.2 Copyright ©2007 Blue Newt Software, LLC and Skew Matrix Software, LLC This work is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 License. To view a copy of this license, visit: http://creativecommons.org/licenses/by-nc-sa/3.0/ Blue Newt Software, LLC 445 Second Street Ann Arbor, MI 48103, USA http://www.blue-newt.com Skew Matrix Software, LLC 284 W. Elm St. Louisville, CO 80027, USA http://www.skew-matrix.com First Printing, December 2007 Contents Preface iii Audience ............................................... iv Recommended Reading ........................................ iv Organization of the Book ....................................... v Acknowledgements .......................................... vi 1 Overview of OpenSceneGraph 1 1.1 Design and Architecture .................................... 1 1.1.1 Naming Conventions .................................. 2 1.1.2 Components ...................................... 2 1.2 The osg Library ........................................ 3 1.2.1 Scene Graph Classes .................................. 3 1.2.2 Geometry Classes .................................... 3 1.2.3 State Management Classes ............................... 4 1.2.4 Utilities and Other Classes ............................... 4 1.3 The osgUtil Library ..................................... 4 1.3.1 Intersection ....................................... 5 1.3.2 Optimization ...................................... 5 1.3.3 Geometry Manipulation ................................ 5 1.4 The osgDB Library ....................................... 5 2 OpenSceneGraph Changes: v1.2 to v2.2 9 2.1 Version Number ......................................... 9 ii CONTENTS 2.2 osg: New Additions ....................................... 9 2.2.1 RenderInfo Class .................................... 9 2.2.2 View Class ....................................... 10 2.2.3 Stats Class ....................................... 10 2.2.4 TemplatePrimitiveFunctor Class ............................ 10 2.2.5 StencilTwoSided Class ................................. 10 2.2.6 ScreenIdentifier Class ................................. 10 2.2.7 DataVariance Enumerant ................................ 10 2.2.8 TransferFunction Class ................................. 10 2.2.9 Plane .......................................... 11 2.2.10 StateSet: Access To Dynamic Object Counts ..................... 11 2.2.11 Support For OpenGL Hints ............................... 11 2.2.12 VariablesMask Enumerants ............................... 11 2.2.13 ReferenceFrame Enumerant .............................. 11 2.2.14 AnimationPath ..................................... 11 2.2.15 Matrix .......................................... 11 2.2.16 HeightField ....................................... 12 2.2.17 Timer .......................................... 12 2.2.18 Billboard ........................................ 12 2.2.19 Buffer Object Support ................................. 12 2.2.20 Changes to GraphicsContext .............................. 12 2.2.21 Enhancements to ImageStream ............................. 12 2.2.22 buffered_value And buffered_object ................... 12 2.2.23 Math .......................................... 12 2.2.24 TexMat ......................................... 12 2.2.25 Access To GPU Time .................................. 13 2.2.26 Polytope ........................................ 13 2.3 osg: Bugfixes, Deprecations, and API Changes ........................ 13 2.3.1 Camera and CameraNode ............................... 13 2.3.2 Enhancements to PointSprite and Image ........................ 13 OpenSceneGraph Reference Manual v2.2 CONTENTS iii 2.3.3 Memory Leak Fixed .................................. 13 2.3.4 AutoTransform ..................................... 13 2.3.5 UnitTestFramework Removed ............................. 13 2.3.6 ClipNode Method Name Corrected .......................... 14 2.3.7 CullStack Method Return Value ............................ 14 2.3.8 CullSettings ....................................... 14 2.3.9 BlendColor ....................................... 14 2.3.10 Math .......................................... 14 2.3.11 ArrayList ........................................ 14 2.3.12 State .......................................... 14 2.3.13 Introduction Of Simulation Time ............................ 15 2.3.14 DeleteHandler ..................................... 15 2.3.15 Viewport ........................................ 15 2.3.16 GraphicsThread ..................................... 15 2.3.17 StateAttribute ...................................... 15 2.3.18 Enhancements to Sequence ............................... 15 2.3.19 Change to PrimitiveSet ................................. 16 2.4 osgUtil: New Additions ..................................... 16 2.4.1 ComputeBoundsVisitor ................................. 16 2.4.2 Statistics and StatsVisitor Exported .......................... 16 2.4.3 osgUtil::SceneView and osg::View ........................... 16 2.4.4 Optimizer Flag Added ................................. 16 2.4.5 osgUtil::RenderLeaf .................................. 16 2.4.6 Dynamic Object Counts ................................ 16 2.4.7 Intersection Support .................................. 17 2.5 osgUtil: Bugfixes, Deprecations, and API Changes ...................... 17 2.5.1 LeafDepthSortFunctor ................................. 17 2.5.2 Tesselator ........................................ 17 2.5.3 SceneView ....................................... 17 2.6 osgDB: New Additions ..................................... 17 OpenSceneGraph Reference Manual v2.2 iv CONTENTS 2.6.1 Improved Plugin Access for Static Linking ...................... 17 2.6.2 Improved Extension Alias Registration ........................ 17 2.6.3 Changes to DatabasePager ............................... 18 2.7 osgDB: Bugfixes, Deprecations, and API Changes ...................... 18 2.7.1 ReentrantMutex ..................................... 18 2.7.2 Copy Constructors ................................... 18 2.8 Other Changes within the OpenSceneGraph Suite ....................... 18 2.8.1 New osgViewer Library ................................ 18 2.8.2 New osgManipulator Library .............................. 18 2.8.3 New osgShadow Library ................................ 18 2.8.4 OpenThreads Library Name Change ........................ 19 2.8.5 osgIntrospection .................................... 19 2.8.6 Enhanced Overlay Support ............................... 19 2.8.7 Plugins ......................................... 19 3 OpenSceneGraph Environment Variables 21 3.1 Introduction ........................................... 21 3.2 Environment Variables ..................................... 21 3.2.1 DISPLAY ........................................ 21 3.2.2 DYLD_LIBRARY_PATH ............................... 21 3.2.3 LD_LIBRARY_PATH ................................. 21 3.2.4 LD_LIBRARY64_PATH, LD_LIBRARYN32_PATH ................. 22 3.2.5 LD_LIBRARY_PATH ................................. 22 3.2.6 OSG_COMPILE_CONTEXTS ............................ 22 3.2.7 OSG_COMPUTE_NEAR_FAR_MODE ....................... 22 3.2.8 OSG_CONFIG_FILE ................................. 22 3.2.9 OSG_DATABASE_PAGER_DRAWABLE ...................... 23 3.2.10 OSG_DATABASE_PAGER_GEOMETRY ...................... 23 3.2.11 OSG_DATABASE_PAGER_PRIORITY ....................... 23 3.2.12 OSG_DEFAULT_BIN_SORT_MODE ......................... 23 OpenSceneGraph Reference Manual v2.2 CONTENTS v 3.2.13 OSG_DISABLE_FAST_PATH_IN_DISPLAY_LISTS ................ 24 3.2.14 OSG_DISPLAY_TYPE ................................ 24 3.2.15 OSG_DO_PRE_COMPILE .............................. 24 3.2.16 OSG_DRIVE_MANIPULATOR_HEIGHT ...................... 25 3.2.17 OSG_EYE_SEPARATION ............................... 25 3.2.18 OSGFILEPATH .................................... 25 3.2.19 OSG_FILE_PATH ................................... 25 3.2.20 OSG_GL_EXTENSION_DISABLE .......................... 25 3.2.21 OSG_LD_LIBRARY_PATH .............................. 26 3.2.22 OSG_LIBRARY_PATH ................................ 26 3.2.23 OSG_MAX_NUMBER_OF_GRAPHICS_CONTEXTS ............... 26 3.2.24 OSG_MAX_TEXTURE_SIZE ............................. 26 3.2.25 OSG_MAXIMUM_OBJECTS_TO_COMPILE_PER_FRAME ........... 26 3.2.26 OSG_MINIMUM_COMPILE_TIME_PER_FRAME ................. 26 3.2.27 OSG_NEAR_FAR_RATIO .............................. 26 3.2.28 OSGNOTIFYLEVEL ................................. 27 3.2.29 OSG_NOTIFY_LEVEL ................................ 27 3.2.30 OSG_OPEN_FLIGHT_PLUGIN ........................... 27 3.2.31 OSG_OPTIMIZER ................................... 28 3.2.32 OSG_PROXY_HOST ................................. 29 3.2.33 OSG_PROXY_PORT ................................. 29 3.2.34 OSG_RECORD_CAMERA_PATH_FPS