1/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
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 * (at your option) any later version. The full license is in LICENSE file
6 * included with this distribution, and on the openscenegraph.org website.
8 * This library is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * OpenSceneGraph Public License for more details.
13 * ViewDependentShadow codes Copyright (C) 2008 Wojciech Lewandowski
14 * Thanks to to my company http://www.ai.com.pl for allowing me free this work.
17#ifndef OSGSHADOW_MINIMALCULLBOUNDSSHADOWMAP
18#define OSGSHADOW_MINIMALCULLBOUNDSSHADOWMAP 1
20#include <osgShadow/MinimalShadowMap>
24class OSGSHADOW_EXPORT MinimalCullBoundsShadowMap
25 : public MinimalShadowMap
28 /** Convenient typedef used in definition of ViewData struct and methods */
29 typedef MinimalCullBoundsShadowMap ThisClass;
30 /** Convenient typedef used in definition of ViewData struct and methods */
31 typedef MinimalShadowMap BaseClass;
33 /** Classic OSG constructor */
34 MinimalCullBoundsShadowMap();
36 /** Classic OSG cloning constructor */
37 MinimalCullBoundsShadowMap(
38 const MinimalCullBoundsShadowMap& mcbsm,
39 const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
41 /** Declaration of standard OSG object methods */
42 META_Object( osgShadow, MinimalCullBoundsShadowMap );
45 /** Classic protected OSG destructor */
46 virtual ~MinimalCullBoundsShadowMap(void);
48 struct OSGSHADOW_EXPORT ViewData: public MinimalShadowMap::ViewData
50 virtual void init( ThisClass * st, osgUtil::CullVisitor * cv );
52 virtual void cullShadowReceivingScene( );
54 virtual void aimShadowCastingCamera( const osg::Light *light,
55 const osg::Vec4 &worldLightPos,
56 const osg::Vec3 &worldLightDir,
57 const osg::Vec3 &worldLightUp
60 typedef std::vector< osgUtil::RenderLeaf* > RenderLeafList;
62 static unsigned RemoveOldRenderLeaves
63 ( RenderLeafList &rllNew, RenderLeafList &rllOld );
65 static unsigned RemoveIgnoredRenderLeaves( RenderLeafList &rll );
67 static osg::BoundingBox ComputeRenderLeavesBounds
68 ( RenderLeafList &rll, osg::Matrix & projectionToWorld );
70 static osg::BoundingBox ComputeRenderLeavesBounds
71 ( RenderLeafList &rll, osg::Matrix & projectionToWorld, osg::Polytope & polytope );
73 static void GetRenderLeaves
74 ( osgUtil::RenderBin *rb, RenderLeafList &rll );
77 META_ViewDependentShadowTechniqueData( ThisClass, ThisClass::ViewData )
80} // namespace osgShadow