Changeset 13041 for OpenSceneGraph/trunk/include/osgShadow/DebugShadowMap
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgShadow/DebugShadowMap
r12188 r13041 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 1 /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield 2 2 * 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 3 * This library is open source and may be redistributed and/or modified under 4 * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or 5 5 * (at your option) any later version. The full license is in LICENSE file 6 6 * included with this distribution, and on the openscenegraph.org website. 7 * 7 * 8 8 * This library is distributed in the hope that it will be useful, 9 9 * but WITHOUT ANY WARRANTY; without even the implied warranty of 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 11 * OpenSceneGraph Public License for more details. 12 12 * … … 30 30 /** 31 31 Class used as a layer for debuging resources used by derived xxxShadowMap classes. 32 As designed by its base ViewDepndentShadowTechnique, DebugShadowMap serves mainly as container of 32 As designed by its base ViewDepndentShadowTechnique, DebugShadowMap serves mainly as container of 33 33 DebugShadowMap::ViewData objects. Most of the debuging support work is done by these objects. 34 DebugShadowMap technique only initializes them in initViewDependentData method. 34 DebugShadowMap technique only initializes them in initViewDependentData method. 35 35 36 36 Debuging outputs present: … … 39 39 */ 40 40 41 class OSGSHADOW_EXPORT DebugShadowMap : public ViewDependentShadowTechnique 41 class OSGSHADOW_EXPORT DebugShadowMap : public ViewDependentShadowTechnique 42 42 { 43 43 public : … … 47 47 48 48 They are always based on some underlying level base Technique and they always 49 derive their ViewData from ViewData structure defined in underlying base Technique. 49 derive their ViewData from ViewData structure defined in underlying base Technique. 50 50 51 51 I use some typedefs to make these inheritance patterns easier to declare/define. … … 99 99 struct OSGSHADOW_EXPORT ViewData: public BaseClass::ViewData 100 100 { 101 /** 102 Texture used as ShadowMap - initialized by derived classes. 103 But it has to be defined now since DebugShadowMap::ViewData methods use it 101 /** 102 Texture used as ShadowMap - initialized by derived classes. 103 But it has to be defined now since DebugShadowMap::ViewData methods use it 104 104 */ 105 105 osg::ref_ptr< osg::Texture > _texture; 106 /** 106 /** 107 107 Camera used to render ShadowMap - initialized by derived classes. 108 But it has to be defined now since DebugShadowMap::ViewData methods use it 108 But it has to be defined now since DebugShadowMap::ViewData methods use it 109 109 */ 110 110 osg::ref_ptr< osg::Camera > _camera; … … 146 146 std::map< std::string, osg::BoundingBox > _boundingBoxMap; 147 147 148 osg::ref_ptr<osg::Camera> _cameraDebugHUD; 148 osg::ref_ptr<osg::Camera> _cameraDebugHUD; 149 149 150 150 bool getDebugDraw() { return *_doDebugDrawPtr; } … … 159 159 virtual void cullDebugGeometry( ); 160 160 161 virtual void updateDebugGeometry( const osg::Camera * screenCam, 161 virtual void updateDebugGeometry( const osg::Camera * screenCam, 162 162 const osg::Camera * shadowCam ); 163 163 164 164 void setDebugPolytope( const char * name, 165 165 const ConvexPolyhedron & polytope = *(ConvexPolyhedron*)( NULL ), 166 osg::Vec4 colorOutline = osg::Vec4(0,0,0,0), 166 osg::Vec4 colorOutline = osg::Vec4(0,0,0,0), 167 167 osg::Vec4 colorInside = osg::Vec4(0,0,0,0) ); 168 168 … … 172 172 173 173 static osg::Vec3d computeShadowTexelToPixelError 174 ( const osg::Matrix & mvpwView, 174 ( const osg::Matrix & mvpwView, 175 175 const osg::Matrix & mvpwShadow, 176 const osg::Vec3d & vWorld, 176 const osg::Vec3d & vWorld, 177 177 const osg::Vec3d & vDelta = osg::Vec3d( 0.01,0.01,0.01 ) ); 178 178
