OpenSceneGraph 3.6.5
ShadowedScene
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
14#ifndef OSGSHADOW_SHADOWEDSCENE
15#define OSGSHADOW_SHADOWEDSCENE 1
16
17#include <osg/buffered_value>
18#include <osg/Camera>
19#include <osg/Texture2D>
20#include <osg/TexGenNode>
21
24
25namespace osgShadow {
26
29{
30 public:
31
33
35
37
38 virtual void traverse(osg::NodeVisitor& nv);
39
41 template<class T> void setShadowSettings(const osg::ref_ptr<T>& ss) { setShadowSettings(ss.get()); }
42
44 const ShadowSettings* getShadowSettings() const { return _shadowSettings.get(); }
45
47 template<class T> void setShadowTechnique(const osg::ref_ptr<T>& ss) { setShadowTechnique(ss.get()); }
48
50 const ShadowTechnique* getShadowTechnique() const { return _shadowTechnique.get(); }
51
54
56 void dirty();
57
59 virtual void resizeGLObjectBuffers(unsigned int maxSize);
60
64 virtual void releaseGLObjects(osg::State* = 0) const;
65
66 public:
67
69 void setReceivesShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setReceivesShadowTraversalMask(mask); }
71 unsigned int getReceivesShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getReceivesShadowTraversalMask() : 0xffffffff; }
72
74 void setCastsShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setCastsShadowTraversalMask(mask); }
76 unsigned int getCastsShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getCastsShadowTraversalMask() : 0xffffffff; }
77
78protected:
79
80 virtual ~ShadowedScene();
81
84
85};
86
87}
88
89#endif
The osgShadow library is a NodeKit that extends the core scene graph to add support for a range of sh...
Definition ConvexPolyhedron:33
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
General group node which maintains a list of children.
Definition Group:29
Visitor for type safe operations on osg::Nodes.
Definition NodeVisitor:82
Smart pointer for handling referenced counted objects.
Definition ref_ptr:32
T * get() const
Definition ref_ptr:117
Encapsulates the current applied OpenGL modes, attributes and vertex arrays settings,...
Definition State:80
virtual void releaseGLObjects(osg::State *=0) const
If State is non-zero, this function releases any associated OpenGL objects for the specified graphics...
ShadowSettings * getShadowSettings()
Definition ShadowedScene:43
void cleanSceneGraph()
Clean scene graph from any shadow technique specific nodes, state and drawables.
virtual void resizeGLObjectBuffers(unsigned int maxSize)
Resize any per context GLObject buffers to specified size.
const ShadowTechnique * getShadowTechnique() const
Definition ShadowedScene:50
unsigned int getReceivesShadowTraversalMask() const
deprecated, moved to ShadowSettings.
Definition ShadowedScene:71
osg::ref_ptr< ShadowTechnique > _shadowTechnique
Definition ShadowedScene:83
ShadowedScene(ShadowTechnique *st=0)
ShadowedScene(const ShadowedScene &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
void dirty()
Dirty any cache data structures held in the attached ShadowTechnqiue.
unsigned int getCastsShadowTraversalMask() const
deprecated, moved to ShadowSettings.
Definition ShadowedScene:76
void setShadowSettings(const osg::ref_ptr< T > &ss)
Definition ShadowedScene:41
void setShadowTechnique(ShadowTechnique *technique)
virtual void traverse(osg::NodeVisitor &nv)
Traverse downwards : calls children's accept method with NodeVisitor.
osg::ref_ptr< ShadowSettings > _shadowSettings
Definition ShadowedScene:82
void setReceivesShadowTraversalMask(unsigned int mask)
deprecated, moved to ShadowSettings.
Definition ShadowedScene:69
META_Node(osgShadow, ShadowedScene)
void setShadowTechnique(const osg::ref_ptr< T > &ss)
Definition ShadowedScene:47
void setShadowSettings(ShadowSettings *ss)
const ShadowSettings * getShadowSettings() const
Definition ShadowedScene:44
ShadowTechnique * getShadowTechnique()
Definition ShadowedScene:49
void setCastsShadowTraversalMask(unsigned int mask)
deprecated, moved to ShadowSettings.
Definition ShadowedScene:74
ShadowSettings provides the parameters that the ShadowTechnique should use as a guide for setting up ...
Definition ShadowSettings:25
ShadowTechnique is the base class for different shadow implementations.
Definition ShadowTechnique:32
#define OSGSHADOW_EXPORT
Definition Export:39

osg logo
Generated at Wed Jul 23 2025 00:00:00 for the OpenSceneGraph by doxygen 1.14.0.