Moved CameraCullCallback into ShadowTechnique scope to make it more resusable between various Techniques
This commit is contained in:
parent
1964690baa
commit
d5c68cfa02
@ -58,6 +58,20 @@ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object
|
||||
|
||||
protected :
|
||||
|
||||
class OSGSHADOW_EXPORT CameraCullCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
CameraCullCallback(ShadowTechnique* st);
|
||||
|
||||
virtual void operator()(osg::Node*, osg::NodeVisitor* nv);
|
||||
|
||||
protected:
|
||||
|
||||
ShadowTechnique* _shadowTechnique;
|
||||
};
|
||||
|
||||
|
||||
virtual ~ShadowTechnique();
|
||||
|
||||
friend class ShadowedScene;
|
||||
|
@ -17,6 +17,19 @@
|
||||
|
||||
using namespace osgShadow;
|
||||
|
||||
ShadowTechnique::CameraCullCallback::CameraCullCallback(ShadowTechnique* st):
|
||||
_shadowTechnique(st)
|
||||
{
|
||||
}
|
||||
|
||||
void ShadowTechnique::CameraCullCallback::operator()(osg::Node*, osg::NodeVisitor* nv)
|
||||
{
|
||||
if (_shadowTechnique->getShadowedScene())
|
||||
{
|
||||
_shadowTechnique->getShadowedScene()->osg::Group::traverse(*nv);
|
||||
}
|
||||
}
|
||||
|
||||
ShadowTechnique::ShadowTechnique():
|
||||
_shadowedScene(0),
|
||||
_dirty(true)
|
||||
|
@ -19,25 +19,6 @@
|
||||
|
||||
using namespace osgShadow;
|
||||
|
||||
class CameraCullCallback : public osg::NodeCallback
|
||||
{
|
||||
public:
|
||||
|
||||
CameraCullCallback(ShadowTexture* st):
|
||||
_shadowTexture(st)
|
||||
{
|
||||
}
|
||||
|
||||
virtual void operator()(osg::Node*, osg::NodeVisitor* nv)
|
||||
{
|
||||
_shadowTexture->getShadowedScene()->osg::Group::traverse(*nv);
|
||||
}
|
||||
|
||||
protected:
|
||||
|
||||
ShadowTexture* _shadowTexture;
|
||||
};
|
||||
|
||||
ShadowTexture::ShadowTexture():
|
||||
_textureUnit(1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user