diff --git a/include/osgShadow/ShadowTechnique b/include/osgShadow/ShadowTechnique index a9fc4be4c..0498ac46d 100644 --- a/include/osgShadow/ShadowTechnique +++ b/include/osgShadow/ShadowTechnique @@ -27,7 +27,7 @@ namespace osgShadow { // forward declare ShadowedScene class ShadowedScene; -/** ShadowedScene provides a mechanism for decorating a scene that the needs to have shadows cast upon it.*/ +/** ShadowTechnique is the base class for different shadow implementations.*/ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object { public : @@ -39,6 +39,8 @@ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object virtual const char* libraryName() const { return "osgShadow"; }\ virtual const char* className() const { return "ShadowTechnique"; } + virtual void setShadowedScene(ShadowedScene* ss); + ShadowedScene* getShadowedScene() { return _shadowedScene; } const ShadowedScene* getShadowedScene() const { return _shadowedScene; } diff --git a/src/osgShadow/ShadowTechnique.cpp b/src/osgShadow/ShadowTechnique.cpp index aa5002117..ac43f8927 100644 --- a/src/osgShadow/ShadowTechnique.cpp +++ b/src/osgShadow/ShadowTechnique.cpp @@ -48,6 +48,11 @@ ShadowTechnique::~ShadowTechnique() { } +void ShadowTechnique::setShadowedScene(ShadowedScene* ss) +{ + _shadowedScene = ss; +} + void ShadowTechnique::init() { OSG_NOTICE<cleanSceneGraph(); - _shadowTechnique->_shadowedScene = 0; + _shadowTechnique->setShadowedScene(0); } _shadowTechnique = technique; if (_shadowTechnique.valid()) { - _shadowTechnique->_shadowedScene = this; + _shadowTechnique->setShadowedScene(this); _shadowTechnique->dirty(); } }