Fleshed out a bit more of the ShadowTexture implementation

This commit is contained in:
Robert Osfield
2007-02-16 10:20:10 +00:00
parent 9119f4d3c3
commit fd3a0c25ba
3 changed files with 165 additions and 8 deletions

View File

@@ -15,6 +15,7 @@
#define OSGSHADOW_SHADOWETEXTURE 1
#include <osg/Camera>
#include <osg/Material>
#include <osgShadow/ShadowTechnique>
@@ -30,10 +31,36 @@ class OSGSHADOW_EXPORT ShadowTexture : public ShadowTechnique
META_Object(osgShadow, ShadowTexture);
/** Set the texture unit that the shadow texture will be applied on.*/
void setTextureUnit(unsigned int unit);
/** Get the texture unit that the shadow texture will be applied on.*/
unsigned int getTextureUnit() const { return _textureUnit; }
/** initialize the ShadowedScene and local cached data structures.*/
virtual void init();
/** run the update traversal of the ShadowedScene and update any loca chached data structures.*/
virtual void update(osg::NodeVisitor& nv);
/** run the cull traversal of the ShadowedScene and set up the rendering for this ShadowTechnique.*/
virtual void cull(osgUtil::CullVisitor& cv);
/** Clean scene graph from any shadow technique specific nodes, state and drawables.*/
virtual void cleanSceneGraph();
protected :
virtual ~ShadowTexture() {}
osg::ref_ptr<osg::Camera> _camera;
osg::ref_ptr<osg::TexGen> _texgen;
osg::ref_ptr<osg::Texture2D> _texture;
osg::ref_ptr<osg::StateSet> _stateset;
osg::ref_ptr<osg::Material> _material;
unsigned int _textureUnit;
};
}