Changeset 13041 for OpenSceneGraph/trunk/include/osgShadow/MinimalShadowMap
- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/include/osgShadow/MinimalShadowMap
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 * … … 22 22 namespace osgShadow { 23 23 24 class OSGSHADOW_EXPORT MinimalShadowMap : public StandardShadowMap 24 class OSGSHADOW_EXPORT MinimalShadowMap : public StandardShadowMap 25 25 { 26 26 public : … … 35 35 /** Classic OSG cloning constructor */ 36 36 MinimalShadowMap( 37 const MinimalShadowMap& msm, 37 const MinimalShadowMap& msm, 38 38 const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY); 39 39 … … 70 70 { _shadowReceivingCoarseBoundAccuracy = accuracy; } 71 71 72 ShadowReceivingCoarseBoundAccuracy 72 ShadowReceivingCoarseBoundAccuracy 73 73 getShadowReceivingCoarseBoundAccuracy() const 74 74 { return _shadowReceivingCoarseBoundAccuracy; } … … 78 78 virtual ~MinimalShadowMap(void); 79 79 80 protected: 80 protected: 81 81 // Matrix modellingSpaceToWorld and its inverse 82 82 // are used to define Modelling Space where shadowed scene drawables 83 83 // have minimal (smallest possible extent) bounding boxes. 84 84 85 // Computing visible shadow range in this space 85 // Computing visible shadow range in this space 86 86 // allows for optimal use of ShadowMap resolution. 87 87 88 88 // By default it is set to identity ie computations are in world space. 89 // But it should be set to ElipsoidModel::localToWorld 89 // But it should be set to ElipsoidModel::localToWorld 90 90 // when scene objects are put on earth ellipsoid surface. 91 91 92 // Other scenarios are also possible for example when models are 92 // Other scenarios are also possible for example when models are 93 93 // built in XZY space which would require identity matrix with swapped colums 94 94 95 95 osg::Matrix _modellingSpaceToWorld; 96 96 float _maxFarPlane; 97 float _minLightMargin; 98 ShadowReceivingCoarseBoundAccuracy _shadowReceivingCoarseBoundAccuracy; 97 float _minLightMargin; 98 ShadowReceivingCoarseBoundAccuracy _shadowReceivingCoarseBoundAccuracy; 99 99 100 100 struct OSGSHADOW_EXPORT ViewData: public BaseClass::ViewData … … 116 116 virtual void cullShadowReceivingScene( ); 117 117 118 virtual void aimShadowCastingCamera( 118 virtual void aimShadowCastingCamera( 119 119 const osg::BoundingSphere &bounds, 120 120 const osg::Light *light, … … 132 132 ( const osg::Camera* cameraMain, osg::Camera* cameraShadow, int pass = 1 ); 133 133 134 void cutScenePolytope( const osg::Matrix & matrix, 134 void cutScenePolytope( const osg::Matrix & matrix, 135 135 const osg::Matrix & inverse, 136 const osg::BoundingBox &bb = 136 const osg::BoundingBox &bb = 137 137 osg::BoundingBox(-1,-1,-1,1,1,1) ); 138 138 139 139 osg::BoundingBox computeScenePolytopeBounds 140 ( const osg::Matrix & m = *(osg::Matrix*)(NULL) ); 140 ( const osg::Matrix & m = *(osg::Matrix*)(NULL) ); 141 141 142 142 // Utility methods for adjusting projection matrices
