OpenSceneGraph 3.6.5
MinimalDrawBoundsShadowMap
Go to the documentation of this file.
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
17
18#ifndef OSGSHADOW_MINIMALDRAWBOUNDSSHADOWMAP
19#define OSGSHADOW_MINIMALDRAWBOUNDSSHADOWMAP 1
20
22
23namespace osgShadow {
24
26 : public MinimalShadowMap
27{
28 public :
33
36
39 const MinimalDrawBoundsShadowMap& mdbsm,
41
44
45 protected:
48
83
84 friend struct ViewData;
85
87
88
90
92 {
93 }
94
95 virtual void operator ()( const osg::Camera& camera ) const
96 {
97 if( _vd.valid() )
98 _vd->performBoundAnalysis( camera );
99 }
100
102 };
103
105
107 {
108 }
109
110 virtual bool run(osg::Object* object, osg::Object* data)
111 {
112 osgUtil::CullVisitor *cv = dynamic_cast< osgUtil::CullVisitor *>( data );
113
114 if( _nc.valid() )
115 _nc->run(object, data);
116 else
117 traverse(object, data);
118
119 if( cv )
120 _vd->recordShadowMapParams( );
121
122 return true;
123 }
124
125 protected:
128 };
129};
130
131} // namespace osgShadow
132
133#endif
BoundingBoxd BoundingBox
Definition BoundingBox:257
Matrixd Matrix
Definition Matrix:27
RefMatrixd RefMatrix
Definition Matrix:28
The osgShadow library is a NodeKit that extends the core scene graph to add support for a range of sh...
Definition ConvexPolyhedron:33
Definition Callback:34
bool traverse(osg::Object *object, osg::Object *data)
traverse the nested callbacks or call NodeVisitor::traverse() if the object is Node,...
Camera - is a subclass of Transform which represents encapsulates the settings of a Camera.
Definition Camera:45
Draw callback for custom operations.
Definition Camera:595
Copy Op(erator) used to control whether shallow or deep copy is used during copy construction and clo...
Definition CopyOp:41
@ SHALLOW_COPY
Definition CopyOp:47
Image class for encapsulating the storage texture image data.
Definition Image:179
Base class/standard interface for objects which require IO support, cloning and reference counting.
Definition Object:61
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
Definition Vec2s:20
virtual ~MinimalDrawBoundsShadowMap(void)
Classic protected OSG destructor.
MinimalDrawBoundsShadowMap()
Classic OSG constructor.
MinimalDrawBoundsShadowMap ThisClass
Convenient typedef used in definition of ViewData struct and methods.
Definition MinimalDrawBoundsShadowMap:30
META_ViewDependentShadowTechniqueData(ThisClass, ThisClass::ViewData)
MinimalDrawBoundsShadowMap(const MinimalDrawBoundsShadowMap &mdbsm, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
Classic OSG cloning constructor.
MinimalShadowMap BaseClass
Convenient typedef used in definition of ViewData struct and methods.
Definition MinimalDrawBoundsShadowMap:32
META_Object(osgShadow, MinimalDrawBoundsShadowMap)
Declaration of standard OSG object methods.
Definition MinimalDrawBoundsShadowMap:50
void setShadowCameraProjectionMatrixPtr(osg::RefMatrix *projection)
Definition MinimalDrawBoundsShadowMap:58
virtual void releaseGLObjects(osg::State *=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
osg::ref_ptr< osg::RefMatrix > _projection
Definition MinimalDrawBoundsShadowMap:51
virtual void performBoundAnalysis(const osg::Camera &camera)
ViewData(void)
Definition MinimalDrawBoundsShadowMap:78
osg::RefMatrix * getShadowCameraProjectionMatrixPtr(void)
Definition MinimalDrawBoundsShadowMap:61
virtual void resizeGLObjectBuffers(unsigned int maxSize)
virtual void init(ThisClass *st, osgUtil::CullVisitor *cv)
osg::ref_ptr< osg::Camera > _boundAnalysisCamera
Definition MinimalDrawBoundsShadowMap:55
osg::Vec2s _boundAnalysisSize
Definition MinimalDrawBoundsShadowMap:52
osg::ref_ptr< osg::Image > _boundAnalysisImage
Definition MinimalDrawBoundsShadowMap:53
osg::ref_ptr< osg::Texture2D > _boundAnalysisTexture
Definition MinimalDrawBoundsShadowMap:54
static osg::BoundingBox scanImage(const osg::Image *image, osg::Matrix m)
osg::observer_ptr< osg::Camera > _mainCamera
Definition MinimalDrawBoundsShadowMap:56
osg::observer_ptr< ViewData > _vd
Definition MinimalDrawBoundsShadowMap:101
CameraPostDrawCallback(ViewData *vd)
Definition MinimalDrawBoundsShadowMap:91
virtual bool run(osg::Object *object, osg::Object *data)
Invoke the callback, first parameter is the Object that the callback is attached to,...
Definition MinimalDrawBoundsShadowMap:110
osg::observer_ptr< ViewData > _vd
Definition MinimalDrawBoundsShadowMap:126
CameraCullCallback(ViewData *vd, osg::Callback *nc)
Definition MinimalDrawBoundsShadowMap:106
osg::ref_ptr< osg::Callback > _nc
Definition MinimalDrawBoundsShadowMap:127
MinimalShadowMap()
Classic OSG constructor.
Definition MinimalShadowMap:101
Basic NodeVisitor implementation for rendering a scene.
Definition CullVisitor:49
#define OSGSHADOW_EXPORT
Definition Export:39

osg logo
Generated at Sun Jul 27 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.