ShadowedScene
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_SHADOWEDSCENE
#define OSGSHADOW_SHADOWEDSCENE 1
#include <osg/buffered_value>
#include <osg/Camera>
#include <osg/Texture2D>
#include <osg/TexGenNode>
#include <osgShadow/ShadowTechnique>
#include <osgShadow/ShadowSettings>
namespace osgShadow {
class OSGSHADOW_EXPORT ShadowedScene : public osg::Group
{
public:
ShadowedScene(ShadowTechnique* st=0);
ShadowedScene(const ShadowedScene& es, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY);
META_Node(osgShadow, ShadowedScene);
virtual void traverse(osg::NodeVisitor& nv);
void setShadowSettings(ShadowSettings* ss);
template<class T> void setShadowSettings(const osg::ref_ptr<T>& ss) { setShadowSettings(ss.get()); }
ShadowSettings* getShadowSettings() { return _shadowSettings.get(); }
const ShadowSettings* getShadowSettings() const { return _shadowSettings.get(); }
void setShadowTechnique(ShadowTechnique* technique);
template<class T> void setShadowTechnique(const osg::ref_ptr<T>& ss) { setShadowTechnique(ss.get()); }
ShadowTechnique* getShadowTechnique() { return _shadowTechnique.get(); }
const ShadowTechnique* getShadowTechnique() const { return _shadowTechnique.get(); }
void cleanSceneGraph();
void dirty();
virtual void resizeGLObjectBuffers(unsigned int maxSize);
virtual void releaseGLObjects(osg::State* = 0) const;
public:
void setReceivesShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setReceivesShadowTraversalMask(mask); }
unsigned int getReceivesShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getReceivesShadowTraversalMask() : 0xffffffff; }
void setCastsShadowTraversalMask(unsigned int mask) { if (_shadowSettings.valid()) _shadowSettings->setCastsShadowTraversalMask(mask); }
unsigned int getCastsShadowTraversalMask() const { return _shadowSettings.valid() ? _shadowSettings->getCastsShadowTraversalMask() : 0xffffffff; }
protected:
virtual ~ShadowedScene();
osg::ref_ptr<ShadowSettings> _shadowSettings;
osg::ref_ptr<ShadowTechnique> _shadowTechnique;
};
}
#endif
Camera
ShadowSettings
ShadowTechnique
TexGenNode
Texture2D
buffered_value
osgShadow::ShadowSettings
Definition ShadowSettings:25
osgShadow::ShadowTechnique
Definition ShadowTechnique:32
osgShadow::ShadowedScene::releaseGLObjects
virtual void releaseGLObjects(osg::State *=0) const
osgShadow::ShadowedScene::getShadowSettings
ShadowSettings * getShadowSettings()
Definition ShadowedScene:43
osgShadow::ShadowedScene::cleanSceneGraph
void cleanSceneGraph()
osgShadow::ShadowedScene::resizeGLObjectBuffers
virtual void resizeGLObjectBuffers(unsigned int maxSize)
osgShadow::ShadowedScene::getShadowTechnique
const ShadowTechnique * getShadowTechnique() const
Definition ShadowedScene:50
osgShadow::ShadowedScene::getReceivesShadowTraversalMask
unsigned int getReceivesShadowTraversalMask() const
Definition ShadowedScene:71
osgShadow::ShadowedScene::_shadowTechnique
osg::ref_ptr< ShadowTechnique > _shadowTechnique
Definition ShadowedScene:83
osgShadow::ShadowedScene::ShadowedScene
ShadowedScene(ShadowTechnique *st=0)
osgShadow::ShadowedScene::ShadowedScene
ShadowedScene(const ShadowedScene &es, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
osgShadow::ShadowedScene::dirty
void dirty()
osgShadow::ShadowedScene::getCastsShadowTraversalMask
unsigned int getCastsShadowTraversalMask() const
Definition ShadowedScene:76
osgShadow::ShadowedScene::setShadowSettings
void setShadowSettings(const osg::ref_ptr< T > &ss)
Definition ShadowedScene:41
osgShadow::ShadowedScene::setShadowTechnique
void setShadowTechnique(ShadowTechnique *technique)
osgShadow::ShadowedScene::traverse
virtual void traverse(osg::NodeVisitor &nv)
osgShadow::ShadowedScene::_shadowSettings
osg::ref_ptr< ShadowSettings > _shadowSettings
Definition ShadowedScene:82
osgShadow::ShadowedScene::setReceivesShadowTraversalMask
void setReceivesShadowTraversalMask(unsigned int mask)
Definition ShadowedScene:69
osgShadow::ShadowedScene::META_Node
META_Node(osgShadow, ShadowedScene)
osgShadow::ShadowedScene::setShadowTechnique
void setShadowTechnique(const osg::ref_ptr< T > &ss)
Definition ShadowedScene:47
osgShadow::ShadowedScene::~ShadowedScene
virtual ~ShadowedScene()
osgShadow::ShadowedScene::setShadowSettings
void setShadowSettings(ShadowSettings *ss)
osgShadow::ShadowedScene::getShadowSettings
const ShadowSettings * getShadowSettings() const
Definition ShadowedScene:44
osgShadow::ShadowedScene::getShadowTechnique
ShadowTechnique * getShadowTechnique()
Definition ShadowedScene:49
osgShadow::ShadowedScene::setCastsShadowTraversalMask
void setCastsShadowTraversalMask(unsigned int mask)
Definition ShadowedScene:74
osg::CopyOp
Definition CopyOp:41
osg::CopyOp::SHALLOW_COPY
@ SHALLOW_COPY
Definition CopyOp:47
osg::Group
Definition Group:29
osg::NodeVisitor
Definition NodeVisitor:82
osg::State
Definition State:80
osg::ref_ptr
Definition ref_ptr:32
osg::ref_ptr::get
T * get() const
Definition ref_ptr:117
osgShadow
Definition ConvexPolyhedron:33
OSGSHADOW_EXPORT
#define OSGSHADOW_EXPORT
Definition osgShadow/Export:39