SoShadowVolume Class Reference

List of all members.

Detailed Description

Class defining a shadow volume of one scene object for one light.

This "shadow volume" consists of a number of shadow volumes created for every shadow casting triangle.

Definition at line 76 of file SoShadowVolume.h.

Public Member Functions

 SoShadowVolume (SoShadowLight *l, int cn)
 Constructor.
 ~SoShadowVolume ()
 Destructor.
void create ()
 Creates object's shadow volume for one light.
int getCasterName ()
 Return the asociated caster name index.
void writeShadowVolume (const char *filename)
 Writes generated shadow node scene graph into a file.

Static Public Member Functions

static SbVec3f faceNormal (const SbVec3f p1, const SbVec3f p2, const SbVec3f p3)
 Computes the triangle normal vector from its verteces.
static SbVec3f farPointNew (SbVec3f lightVec, SbVec3f point, float farDepth)
 Computes shadow volume far plane point (far cap) - a new version.

Public Attributes

int32_t nScTr
 Number of shadow casting triangles of the object.
int32_t nSVTr
 Number of triangles of the shadow volume.

Private Member Functions

void init ()
 Initializator.

Private Attributes

SoShadowLightshadowlight
 Pointer to shadow light.
SoLight * aLight
 Which light creates this shadow volume.
SoShadowCastercaster
 Object model.
CObjectModelobjectModel
 Object model.
SbMatrix * trMatrix
 Transformation matrix of the object.
SoCoordinate3 * coordNode
 SV coordinates.
SbColor svColor
 Volume color.
SoTransform * transform
 Transform node.
int casterName
 index name of caster that casts this volume.
SoGroup * initNode
 Node of shadow volumes material and translation settings.
SoGroup * volumeNode
 Node of shadow volumes of light-facing triangles.


Constructor & Destructor Documentation

SoShadowVolume::SoShadowVolume SoShadowLight l,
int  cn
 

Constructor.

Parameters:
l Pointer to light that casts this volume.
cn Pointer to shadow caster that casts this volume.

Definition at line 44 of file SoShadowVolume.cpp.

References aLight, caster, casterName, SoShadowCaster::getCasterName(), SoShadowLight::getLight(), init(), initNode, nScTr, nSVTr, objectModel, ONDEBUG, shadowlight, transform, trMatrix, and volumeNode.

SoShadowVolume::~SoShadowVolume  ) 
 

Destructor.

Definition at line 80 of file SoShadowVolume.cpp.


Member Function Documentation

void SoShadowVolume::init  )  [private]
 

Initializator.

Definition at line 89 of file SoShadowVolume.cpp.

References initNode, svColor, transform, and volumeNode.

Referenced by SoShadowVolume().

void SoShadowVolume::create  ) 
 

Creates object's shadow volume for one light.

Definition at line 139 of file SoShadowVolume.cpp.

References aLight, caster, casterName, SoShadowCaster::getMatrix(), SoShadowCaster::getObjectModel(), SoShadowCaster::moved(), objectModel, ONDEBUG, SoShadowCaster::setMoved(), SoShadowCaster::trMatrix, trMatrix, and SoShadowCaster::trMatrixOld.

Referenced by CShadowManager::createCasterVolumes().

int SoShadowVolume::getCasterName  ) 
 

Return the asociated caster name index.

Returns:
Caster name index.

Definition at line 130 of file SoShadowVolume.cpp.

References casterName.

Referenced by CShadowManager::createCasterVolumes().

void SoShadowVolume::writeShadowVolume const char *  filename  ) 
 

Writes generated shadow node scene graph into a file.

Parameters:
filename Output filename.

Definition at line 475 of file SoShadowVolume.cpp.

References ONDEBUG.

SbVec3f SoShadowVolume::faceNormal const SbVec3f  p1,
const SbVec3f  p2,
const SbVec3f  p3
[static]
 

Computes the triangle normal vector from its verteces.

Counterclockwise orientation.

Parameters:
p1 point 1
p2 point 2
p3 point 3
Returns:
A normal vector.

Definition at line 547 of file SoShadowVolume.cpp.

References ONDEBUG.

SbVec3f SoShadowVolume::farPointNew SbVec3f  lightVec,
SbVec3f  point,
float  farDepth
[static]
 

Computes shadow volume far plane point (far cap) - a new version.

Melo by se dodelat tak, ze bude az na zadni orez. rovine.

Parameters:
lightVec Light direction vector.
point Vertex of a light facing triangle.
farDepth Depth of a shadow volume.
Returns:
A point of a far cap of the shadow volume.

Definition at line 526 of file SoShadowVolume.cpp.


Member Data Documentation

SoShadowLight* SoShadowVolume::shadowlight [private]
 

Pointer to shadow light.

Definition at line 80 of file SoShadowVolume.h.

Referenced by SoShadowVolume().

SoLight* SoShadowVolume::aLight [private]
 

Which light creates this shadow volume.

Definition at line 82 of file SoShadowVolume.h.

Referenced by create(), and SoShadowVolume().

SoShadowCaster* SoShadowVolume::caster [private]
 

Object model.

Definition at line 84 of file SoShadowVolume.h.

Referenced by create(), and SoShadowVolume().

CObjectModel* SoShadowVolume::objectModel [private]
 

Object model.

Definition at line 86 of file SoShadowVolume.h.

Referenced by create(), and SoShadowVolume().

SbMatrix* SoShadowVolume::trMatrix [private]
 

Transformation matrix of the object.

Definition at line 88 of file SoShadowVolume.h.

Referenced by create(), and SoShadowVolume().

SoCoordinate3* SoShadowVolume::coordNode [private]
 

SV coordinates.

Definition at line 90 of file SoShadowVolume.h.

SbColor SoShadowVolume::svColor [private]
 

Volume color.

Definition at line 92 of file SoShadowVolume.h.

Referenced by init().

SoTransform* SoShadowVolume::transform [private]
 

Transform node.

Definition at line 94 of file SoShadowVolume.h.

Referenced by init(), and SoShadowVolume().

int SoShadowVolume::casterName [private]
 

index name of caster that casts this volume.

Definition at line 96 of file SoShadowVolume.h.

Referenced by create(), getCasterName(), and SoShadowVolume().

SoGroup* SoShadowVolume::initNode [private]
 

Node of shadow volumes material and translation settings.

Definition at line 98 of file SoShadowVolume.h.

Referenced by init(), and SoShadowVolume().

SoGroup* SoShadowVolume::volumeNode [private]
 

Node of shadow volumes of light-facing triangles.

Definition at line 100 of file SoShadowVolume.h.

Referenced by init(), and SoShadowVolume().

int32_t SoShadowVolume::nScTr
 

Number of shadow casting triangles of the object.

Definition at line 106 of file SoShadowVolume.h.

Referenced by SoShadowVolume().

int32_t SoShadowVolume::nSVTr
 

Number of triangles of the shadow volume.

Definition at line 108 of file SoShadowVolume.h.

Referenced by SoShadowVolume().


The documentation for this class was generated from the following files:
Generated on Wed May 17 17:27:52 2006 for Shadow Engine by  doxygen 1.4.6-NO