Flesh out more of basic ShadowTechnique and ShadowedScene API.

This commit is contained in:
Robert Osfield
2007-02-08 17:23:40 +00:00
parent 47622e6134
commit 95befaf1ed
5 changed files with 120 additions and 24 deletions

View File

@@ -35,11 +35,28 @@ class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object
ShadowTechnique(const ShadowTechnique& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Object(osgShadow, ShadowTechnique);
ShadowedScene* getShadowedScene() { return _shadowedScene; }
virtual void init();
virtual void update(osg::NodeVisitor& nv);
virtual void cull(osg::NodeVisitor& nv);
virtual void traverse(osg::NodeVisitor& nv);
virtual void dirty() { _dirty = true; }
protected :
virtual ~ShadowTechnique() {}
friend class ShadowedScene;
ShadowedScene* _shadowedScene;
bool _dirty;
};
}

View File

@@ -26,7 +26,8 @@ namespace osgShadow {
/** ShadowedScene provides a mechansim for decorating a scene that the needs to have shadows cast upon it.*/
class OSGSHADOW_EXPORT ShadowedScene : public osg::Group
{
public :
public:
ShadowedScene();
ShadowedScene(const ShadowedScene& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
@@ -44,11 +45,13 @@ class OSGSHADOW_EXPORT ShadowedScene : public osg::Group
void setShadowTechnique(ShadowTechnique* technique);
ShadowTechnique* getShadowTechnique() { return _shadowTechnique.get(); }
const ShadowTechnique* getShadowTechnique() const { return _shadowTechnique.get(); }
protected :
virtual ~ShadowedScene() {}
/** Dirty any cache data structures held in the attached ShadowTechnqiue.*/
void dirty();
protected:
virtual ~ShadowedScene();
unsigned int _recievesShadowTraversalMask;
unsigned int _castsShadowTraversalMask;