OpenSceneGraph 2.8.3

osgShadow::OccluderGeometry Class Reference

OccluderGeometry provides a sepecialised geometry representation of objects in scene that occlude light and therefore cast shadows. More...

Inheritance diagram for osgShadow::OccluderGeometry:

List of all members.

Classes

struct  Edge

Public Types

typedef std::vector< osg::Vec3Vec3List
typedef std::vector< GLuint > UIntList

Public Member Functions

 OccluderGeometry ()
 OccluderGeometry (const OccluderGeometry &oc, const osg::CopyOp &copyop=osg::CopyOp::SHALLOW_COPY)
virtual Object * cloneType () const
 Clone the type of an object, with Object* return type.
virtual Object * clone (const osg::CopyOp &copyop) const
 Clone an object, with Object* return type.
virtual bool isSameKindAs (const osg::Object *obj) const
virtual const char * libraryName () const
 return the name of the object's library.
virtual const char * className () const
 return the name of the object's class type.
void computeOccluderGeometry (osg::Node *subgraph, osg::Matrix *matrix=0, float sampleRatio=1.0f)
 Compute an occluder geometry containing all the geometry in specified subgraph.
void computeOccluderGeometry (osg::Drawable *drawable, osg::Matrix *matrix=0, float sampleRatio=1.0f)
 Compute an occluder geometry containing the geometry in specified drawable.
void computeShadowVolumeGeometry (const osg::Vec4 &lightpos, ShadowVolumeGeometry &svg) const
 Compute ShadowVolumeGeometry.
void setBoundingPolytope (const osg::Polytope &polytope)
 Set the bounding polytope of the OccluderGeometry.
osg::PolytopegetBoundingPolytope ()
 Get the bounding polytope of the OccluderGeometry.
const osg::PolytopegetBoundingPolytope () const
 Get the const bounding polytope of the OccluderGeometry.
virtual void drawImplementation (osg::RenderInfo &renderInfo) const
 Render the occluder geometry.
virtual osg::BoundingBox computeBound () const
 Compute the bounding box around occluder geometry.
void processGeometry (osg::Drawable *drawable, osg::Matrix *matrix=0, float sampleRatio=1.0f)

Protected Types

typedef std::vector< EdgeEdgeList

Protected Member Functions

virtual ~OccluderGeometry ()
bool isLightPointSilhouetteEdge (const osg::Vec3 &lightpos, const Edge &edge) const
bool isLightDirectionSilhouetteEdge (const osg::Vec3 &lightdirection, const Edge &edge) const
void setUpInternalStructures ()
void removeDuplicateVertices ()
void removeNullTriangles ()
void computeNormals ()
void buildEdgeMaps ()
void computeLightDirectionSilhouetteEdges (const osg::Vec3 &lightdirection, UIntList &silhouetteIndices) const
void computeLightPositionSilhouetteEdges (const osg::Vec3 &lightpos, UIntList &silhouetteIndices) const

Protected Attributes

osg::Polytope _boundingPolytope
Vec3List _vertices
Vec3List _normals
Vec3List _triangleNormals
UIntList _triangleIndices
EdgeList _edges

Detailed Description

OccluderGeometry provides a sepecialised geometry representation of objects in scene that occlude light and therefore cast shadows.

OccluderGeometry supports the computation of silhouette edges and shadow volume geometries, as well as use as geometry that one can rendering into a shadow map or end caps for the ZP+ algorithm. OccluderGeometry may be of the same resolution as an underlying geometry that it represents, or can be of lower resolution and combine manager seperate geometries together into a single shadow casting object. OccluderGeometry may be attached as UserData to Nodes or to Drawables.


Member Typedef Documentation

typedef std::vector<Edge> osgShadow::OccluderGeometry::EdgeList [protected]
typedef std::vector<GLuint> osgShadow::OccluderGeometry::UIntList

Constructor & Destructor Documentation

osgShadow::OccluderGeometry::OccluderGeometry ( )
osgShadow::OccluderGeometry::OccluderGeometry ( const OccluderGeometry oc,
const osg::CopyOp copyop = osg::CopyOp::SHALLOW_COPY 
)
virtual osgShadow::OccluderGeometry::~OccluderGeometry ( ) [inline, protected, virtual]

Member Function Documentation

void osgShadow::OccluderGeometry::buildEdgeMaps ( ) [protected]
virtual const char* osgShadow::OccluderGeometry::className ( ) const [inline, virtual]

return the name of the object's class type.

Must be defined by derived classes.

Reimplemented from osg::Drawable.

virtual Object* osgShadow::OccluderGeometry::clone ( const osg::CopyOp ) const [inline, virtual]

Clone an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual Object* osgShadow::OccluderGeometry::cloneType ( ) const [inline, virtual]

Clone the type of an object, with Object* return type.

Must be defined by derived classes.

Implements osg::Object.

virtual osg::BoundingBox osgShadow::OccluderGeometry::computeBound ( ) const [virtual]

Compute the bounding box around occluder geometry.

Reimplemented from osg::Drawable.

void osgShadow::OccluderGeometry::computeLightDirectionSilhouetteEdges ( const osg::Vec3 lightdirection,
UIntList silhouetteIndices 
) const [protected]
void osgShadow::OccluderGeometry::computeLightPositionSilhouetteEdges ( const osg::Vec3 lightpos,
UIntList silhouetteIndices 
) const [protected]
void osgShadow::OccluderGeometry::computeNormals ( ) [protected]
void osgShadow::OccluderGeometry::computeOccluderGeometry ( osg::Node subgraph,
osg::Matrix matrix = 0,
float  sampleRatio = 1.0f 
)

Compute an occluder geometry containing all the geometry in specified subgraph.

void osgShadow::OccluderGeometry::computeOccluderGeometry ( osg::Drawable drawable,
osg::Matrix matrix = 0,
float  sampleRatio = 1.0f 
)

Compute an occluder geometry containing the geometry in specified drawable.

void osgShadow::OccluderGeometry::computeShadowVolumeGeometry ( const osg::Vec4 lightpos,
ShadowVolumeGeometry svg 
) const
virtual void osgShadow::OccluderGeometry::drawImplementation ( osg::RenderInfo renderInfo) const [virtual]

Render the occluder geometry.

Implements osg::Drawable.

const osg::Polytope& osgShadow::OccluderGeometry::getBoundingPolytope ( ) const [inline]

Get the const bounding polytope of the OccluderGeometry.

osg::Polytope& osgShadow::OccluderGeometry::getBoundingPolytope ( ) [inline]

Get the bounding polytope of the OccluderGeometry.

bool osgShadow::OccluderGeometry::isLightDirectionSilhouetteEdge ( const osg::Vec3 lightdirection,
const Edge edge 
) const [inline, protected]
bool osgShadow::OccluderGeometry::isLightPointSilhouetteEdge ( const osg::Vec3 lightpos,
const Edge edge 
) const [inline, protected]
virtual bool osgShadow::OccluderGeometry::isSameKindAs ( const osg::Object obj) const [inline, virtual]

Reimplemented from osg::Drawable.

References NULL.

virtual const char* osgShadow::OccluderGeometry::libraryName ( ) const [inline, virtual]

return the name of the object's library.

Must be defined by derived classes. The OpenSceneGraph convention is that the namespace of a library is the same as the library name.

Reimplemented from osg::Drawable.

void osgShadow::OccluderGeometry::processGeometry ( osg::Drawable drawable,
osg::Matrix matrix = 0,
float  sampleRatio = 1.0f 
)
void osgShadow::OccluderGeometry::removeDuplicateVertices ( ) [protected]
void osgShadow::OccluderGeometry::removeNullTriangles ( ) [protected]
void osgShadow::OccluderGeometry::setBoundingPolytope ( const osg::Polytope polytope) [inline]

Set the bounding polytope of the OccluderGeometry.

void osgShadow::OccluderGeometry::setUpInternalStructures ( ) [protected]

Member Data Documentation


The documentation for this class was generated from the following file:

osg logo
Generated at Tue Mar 22 2011 13:20:28 for the OpenSceneGraph by doxygen 1.7.3.