Flesh out more of basic ShadowTechnique and ShadowedScene API.
This commit is contained in:
@@ -12,14 +12,59 @@
|
||||
*/
|
||||
|
||||
#include <osgShadow/ShadowTechnique>
|
||||
#include <osgShadow/ShadowedScene>
|
||||
#include <osg/Notify>
|
||||
|
||||
using namespace osgShadow;
|
||||
|
||||
ShadowTechnique::ShadowTechnique()
|
||||
ShadowTechnique::ShadowTechnique():
|
||||
_shadowedScene(0),
|
||||
_dirty(true)
|
||||
{
|
||||
}
|
||||
|
||||
ShadowTechnique::ShadowTechnique(const ShadowTechnique& copy, const osg::CopyOp& copyop):
|
||||
osg::Object(copy,copyop)
|
||||
osg::Object(copy,copyop),
|
||||
_shadowedScene(0),
|
||||
_dirty(true)
|
||||
{
|
||||
}
|
||||
|
||||
void ShadowTechnique::init()
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<className()<<"::init() not implemened yet"<<std::endl;
|
||||
|
||||
_dirty = false;
|
||||
}
|
||||
|
||||
void ShadowTechnique::update(osg::NodeVisitor& nv)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<className()<<"::update(osg::NodeVisitor&) not implemened yet."<<std::endl;
|
||||
_shadowedScene->osg::Group::traverse(nv);
|
||||
}
|
||||
|
||||
void ShadowTechnique::cull(osg::NodeVisitor& nv)
|
||||
{
|
||||
osg::notify(osg::NOTICE)<<className()<<"::cull(osg::NodeVisitor&) not implemened yet."<<std::endl;
|
||||
_shadowedScene->osg::Group::traverse(nv);
|
||||
}
|
||||
|
||||
void ShadowTechnique::traverse(osg::NodeVisitor& nv)
|
||||
{
|
||||
if (!_shadowedScene) return;
|
||||
|
||||
if (nv.getVisitorType() == osg::NodeVisitor::UPDATE_VISITOR)
|
||||
{
|
||||
if (_dirty) init();
|
||||
|
||||
update(nv);
|
||||
}
|
||||
else if (nv.getVisitorType() == osg::NodeVisitor::CULL_VISITOR)
|
||||
{
|
||||
cull(nv);
|
||||
}
|
||||
else
|
||||
{
|
||||
_shadowedScene->osg::Group::traverse(nv);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user