MinimalCullBoundsShadowMap 3.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182
  1. /* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
  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
  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.
  7. *
  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.
  12. *
  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.
  15. */
  16. #ifndef OSGSHADOW_MINIMALCULLBOUNDSSHADOWMAP
  17. #define OSGSHADOW_MINIMALCULLBOUNDSSHADOWMAP 1
  18. #include <osgShadow/MinimalShadowMap>
  19. namespace osgShadow {
  20. class OSGSHADOW_EXPORT MinimalCullBoundsShadowMap
  21. : public MinimalShadowMap
  22. {
  23. public :
  24. /** Convenient typedef used in definition of ViewData struct and methods */
  25. typedef MinimalCullBoundsShadowMap ThisClass;
  26. /** Convenient typedef used in definition of ViewData struct and methods */
  27. typedef MinimalShadowMap BaseClass;
  28. /** Classic OSG constructor */
  29. MinimalCullBoundsShadowMap();
  30. /** Classic OSG cloning constructor */
  31. MinimalCullBoundsShadowMap(
  32. const MinimalCullBoundsShadowMap& mcbsm,
  33. const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
  34. /** Declaration of standard OSG object methods */
  35. META_Object( osgShadow, MinimalCullBoundsShadowMap );
  36. protected:
  37. /** Classic protected OSG destructor */
  38. virtual ~MinimalCullBoundsShadowMap(void);
  39. struct OSGSHADOW_EXPORT ViewData: public MinimalShadowMap::ViewData
  40. {
  41. virtual void init( ThisClass * st, osgUtil::CullVisitor * cv );
  42. virtual void cullShadowReceivingScene( );
  43. virtual void aimShadowCastingCamera( const osg::Light *light,
  44. const osg::Vec4 &worldLightPos,
  45. const osg::Vec3 &worldLightDir,
  46. const osg::Vec3 &worldLightUp
  47. = osg::Vec3(0,1,0) );
  48. typedef std::vector< osgUtil::RenderLeaf* > RenderLeafList;
  49. static unsigned RemoveOldRenderLeaves
  50. ( RenderLeafList &rllNew, RenderLeafList &rllOld );
  51. static unsigned RemoveIgnoredRenderLeaves( RenderLeafList &rll );
  52. static osg::BoundingBox ComputeRenderLeavesBounds
  53. ( RenderLeafList &rll, osg::Matrix & projectionToWorld );
  54. static osg::BoundingBox ComputeRenderLeavesBounds
  55. ( RenderLeafList &rll, osg::Matrix & projectionToWorld, osg::Polytope & polytope );
  56. static void GetRenderLeaves
  57. ( osgUtil::RenderBin *rb, RenderLeafList &rll );
  58. };
  59. META_ViewDependentShadowTechniqueData( ThisClass, ThisClass::ViewData )
  60. };
  61. } // namespace osgShadow
  62. #endif