ShadowTechnique
Go to the documentation of this file.
/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2006 Robert Osfield
*
* This library is open source and may be redistributed and/or modified under
* the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or
* (at your option) any later version. The full license is in LICENSE file
* included with this distribution, and on the openscenegraph.org website.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* OpenSceneGraph Public License for more details.
*/
#ifndef OSGSHADOW_SHADOWEDTECHNIQUE
#define OSGSHADOW_SHADOWEDTECHNIQUE 1
#include <osg/buffered_value>
#include <osg/Camera>
#include <osg/Texture2D>
#include <osg/TexGenNode>
#include <osgUtil/CullVisitor>
#include <osgShadow/Export>
namespace osgShadow {
// forward declare ShadowedScene
class ShadowedScene;
class OSGSHADOW_EXPORT ShadowTechnique : public osg::Object
{
public :
ShadowTechnique();
ShadowTechnique(const ShadowTechnique& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
virtual bool isSameKindAs(const osg::Object* obj) const { return dynamic_cast<const ShadowTechnique*>(obj)!=NULL; } \
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; }
virtual void init();
virtual void update(osg::NodeVisitor& nv);
virtual void cull(osgUtil::CullVisitor& cv);
virtual void cleanSceneGraph();
virtual void traverse(osg::NodeVisitor& nv);
virtual void dirty() { _dirty = true; }
virtual void resizeGLObjectBuffers(unsigned int maxSize) = 0;
virtual void releaseGLObjects(osg::State* = 0) const = 0;
protected :
class OSGSHADOW_EXPORT CameraCullCallback : public osg::NodeCallback
{
public:
CameraCullCallback(ShadowTechnique* st);
virtual void operator()(osg::Node*, osg::NodeVisitor* nv);
protected:
ShadowTechnique* _shadowTechnique;
};
osg::Vec3 computeOrthogonalVector(const osg::Vec3& direction) const;
virtual ~ShadowTechnique();
friend class ShadowedScene;
ShadowedScene* _shadowedScene;
bool _dirty;
};
}
#endif
Camera
CullVisitor
TexGenNode
Texture2D
buffered_value
osgShadow::ShadowTechnique::CameraCullCallback::operator()
virtual void operator()(osg::Node *, osg::NodeVisitor *nv)
osgShadow::ShadowTechnique::CameraCullCallback::CameraCullCallback
CameraCullCallback(ShadowTechnique *st)
osgShadow::ShadowTechnique::CameraCullCallback::_shadowTechnique
ShadowTechnique * _shadowTechnique
Definition ShadowTechnique:85
osgShadow::ShadowTechnique::update
virtual void update(osg::NodeVisitor &nv)
osgShadow::ShadowTechnique::className
virtual const char * className() const
Definition ShadowTechnique:40
osgShadow::ShadowTechnique::setShadowedScene
virtual void setShadowedScene(ShadowedScene *ss)
osgShadow::ShadowTechnique::_shadowedScene
ShadowedScene * _shadowedScene
Definition ShadowTechnique:94
osgShadow::ShadowTechnique::releaseGLObjects
virtual void releaseGLObjects(osg::State *=0) const =0
osgShadow::ShadowTechnique::ShadowTechnique
ShadowTechnique(const ShadowTechnique &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgShadow::ShadowTechnique::_dirty
bool _dirty
Definition ShadowTechnique:95
osgShadow::ShadowTechnique::cull
virtual void cull(osgUtil::CullVisitor &cv)
osgShadow::ShadowTechnique::cleanSceneGraph
virtual void cleanSceneGraph()
osgShadow::ShadowTechnique::init
virtual void init()
osgShadow::ShadowTechnique::getShadowedScene
const ShadowedScene * getShadowedScene() const
Definition ShadowTechnique:46
osgShadow::ShadowTechnique::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgShadow::ShadowTechnique::dirty
virtual void dirty()
Definition ShadowTechnique:63
osgShadow::ShadowTechnique::isSameKindAs
virtual bool isSameKindAs(const osg::Object *obj) const
Definition ShadowTechnique:38
osgShadow::ShadowTechnique::ShadowTechnique
ShadowTechnique()
osgShadow::ShadowTechnique::libraryName
virtual const char * libraryName() const
Definition ShadowTechnique:39
osgShadow::ShadowTechnique::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)=0
osgShadow::ShadowTechnique::ShadowedScene
friend class ShadowedScene
Definition ShadowTechnique:92
osgShadow::ShadowTechnique::computeOrthogonalVector
osg::Vec3 computeOrthogonalVector(const osg::Vec3 &direction) const
osgShadow::ShadowTechnique::~ShadowTechnique
virtual ~ShadowTechnique()
osgShadow::ShadowTechnique::getShadowedScene
ShadowedScene * getShadowedScene()
Definition ShadowTechnique:44
osgUtil::CullVisitor
Definition CullVisitor:49
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::NodeCallback
Definition Callback:215
osg::NodeVisitor
Definition NodeVisitor:82
osg::Node
Definition Node:72
osg::Object
Definition Object:61
osg::State
Definition State:80
osgShadow
Definition ConvexPolyhedron:33
osg::Vec3
Vec3f Vec3
Definition Vec3:21
Export
OSGSHADOW_EXPORT
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39
NULL
#define NULL
Definition osg/Export:55