CShadowCaster Class Reference

List of all members.

Detailed Description

Class defining a shadow caster node of the Shadow Manager.

When a shadow casting scene object is added into the Shadow Manager, a new node called Shadow Caster is created for it. It contains object's model and it is a parent node of all object's shadow volume nodes.

Definition at line 71 of file ShadowCaster.h.

Public Member Functions

 CShadowCaster (CShadowManager *sm, SoSeparator *or)
 Constructor.
 ~CShadowCaster ()
 Destructor.
SoSeparator * getObjectNode ()
 Returns object node pointer.
CObjectModelgetObjectModel ()
 Set object move flag.
SbMatrix * getMatrix ()
 Set object move flag.
void setCasterName (int objectIndex)
 Sets caster name index and the name of the node.
int getCasterName ()
 Gets caster name index.
void setMoveSensor (SoPathSensor *sensor)
 Sets object move sensor.
void setShapeSensor (SoNodeSensor *sensor)
 Sets object moveSensor geom.
SoPathSensor * getMoveSensor ()
 Gets object move sensor.
SoNodeSensor * getShapeSensor ()
 Gets object shape sensor.
void createFaceModel ()
 Create indexed Face Set model of the object in it's local coords.
void showFaceModel ()
 Adds object model to the scene graph.
void createShadowVolumes ()
 Re-computes all shadow volumes of this object and all lights.
void setMoved (bool m)
 Set object move flag.
bool moved ()
 Return object move flag.

Public Attributes

CObjectModelobjectModel
 Object model.
SbMatrix trMatrix
 Actual transformation matrix of the object.
SbMatrix trMatrixOld
 Previous transformation matrix of the object.
SoPath * path
 Path from scene root to the object node.
SoSeparator * objectRoot
 Shadow casting object root node.

Private Member Functions

bool getTransformationMatrix ()
 Finds and updates model's transformation matrix.

Private Attributes

CShadowManagermanager
 Pointer to shadow manager.
int nameIndex
 Object name index.
SoPathSensor * moveSensor
 Sensor of object movement.
SoNodeSensor * shapeSensor
 Sensor of object change.
bool hasMoved
 Object move flag.


Constructor & Destructor Documentation

CShadowCaster::CShadowCaster CShadowManager sm,
SoSeparator *  or
 

Constructor.

Parameters:
sm Pointer connection to the Shadow Manager.
or Pointer connection to the scene object node.

Definition at line 44 of file ShadowCaster.cpp.

References getTransformationMatrix(), hasMoved, moveSensor, nameIndex, objectModel, path, and shapeSensor.

CShadowCaster::~CShadowCaster  ) 
 

Destructor.

Definition at line 61 of file ShadowCaster.cpp.

References moveSensor, and shapeSensor.


Member Function Documentation

bool CShadowCaster::getTransformationMatrix  )  [private]
 

Finds and updates model's transformation matrix.

Stores previous one before.

Definition at line 202 of file ShadowCaster.cpp.

References ONDEBUG, trMatrix, and trMatrixOld.

Referenced by createShadowVolumes(), and CShadowCaster().

SoSeparator * CShadowCaster::getObjectNode  ) 
 

Returns object node pointer.

Definition at line 73 of file ShadowCaster.cpp.

References objectRoot.

CObjectModel * CShadowCaster::getObjectModel  ) 
 

Set object move flag.

Definition at line 240 of file ShadowCaster.cpp.

References objectModel.

Referenced by SoShadowVolume::create().

SbMatrix * CShadowCaster::getMatrix  ) 
 

Set object move flag.

Definition at line 231 of file ShadowCaster.cpp.

References trMatrix.

Referenced by SoShadowVolume::create().

void CShadowCaster::setCasterName int  objectIndex  ) 
 

Sets caster name index and the name of the node.

Parameters:
objectIndex Auto increment index name.

Definition at line 84 of file ShadowCaster.cpp.

References nameIndex, and ONDEBUG.

Referenced by CShadowManager::addObject().

int CShadowCaster::getCasterName  ) 
 

Gets caster name index.

Returns:
int Index (name) of the object.

Definition at line 100 of file ShadowCaster.cpp.

References nameIndex.

Referenced by CShadowManager::addObject(), CShadowManager::objectShapeCallback(), and SoShadowVolume::SoShadowVolume().

void CShadowCaster::setMoveSensor SoPathSensor *  sensor  ) 
 

Sets object move sensor.

Parameters:
sensor Pointer to the PathSensor to the object node.

Definition at line 111 of file ShadowCaster.cpp.

References moveSensor.

Referenced by CShadowManager::addObject().

void CShadowCaster::setShapeSensor SoNodeSensor *  sensor  ) 
 

Sets object moveSensor geom.

change.

Parameters:
sensor Pointer to the NodeSensor to the object node.

Definition at line 133 of file ShadowCaster.cpp.

References shapeSensor.

Referenced by CShadowManager::addObject().

SoPathSensor * CShadowCaster::getMoveSensor  ) 
 

Gets object move sensor.

Returns:
SoPathSensor * pointer to the object move sensor.

Definition at line 122 of file ShadowCaster.cpp.

References moveSensor.

SoNodeSensor * CShadowCaster::getShapeSensor  ) 
 

Gets object shape sensor.

Returns:
SoNodeSensor * Pointer to the object shape sensor.

Definition at line 144 of file ShadowCaster.cpp.

References shapeSensor.

void CShadowCaster::createFaceModel  ) 
 

Create indexed Face Set model of the object in it's local coords.

Definition at line 153 of file ShadowCaster.cpp.

References CObjectModel::createFaceModel(), objectModel, and showFaceModel().

Referenced by CShadowManager::objectMoveCallback(), and CShadowManager::objectShapeCallback().

void CShadowCaster::showFaceModel  ) 
 

Adds object model to the scene graph.

For debug purposes only.

Definition at line 167 of file ShadowCaster.cpp.

References CObjectModel::getFaceModelNode(), CShadowManager::getSceneRoot(), manager, and objectModel.

Referenced by createFaceModel().

void CShadowCaster::createShadowVolumes  ) 
 

Re-computes all shadow volumes of this object and all lights.

Definition at line 271 of file ShadowCaster.cpp.

References CShadowManager::createCasterVolumes(), getTransformationMatrix(), manager, and ONDEBUG.

Referenced by CShadowManager::objectMoveCallback(), and CShadowManager::objectShapeCallback().

void CShadowCaster::setMoved bool  m  ) 
 

Set object move flag.

Parameters:
m Move flag.

Definition at line 251 of file ShadowCaster.cpp.

References hasMoved.

Referenced by SoShadowVolume::create(), and CShadowManager::objectMoveCallback().

bool CShadowCaster::moved  ) 
 

Return object move flag.

Returns:
True if object has moved.

Definition at line 262 of file ShadowCaster.cpp.

References hasMoved.

Referenced by SoShadowVolume::create().


Member Data Documentation

CObjectModel* CShadowCaster::objectModel
 

Object model.

Definition at line 75 of file ShadowCaster.h.

Referenced by createFaceModel(), CShadowCaster(), getObjectModel(), and showFaceModel().

SbMatrix CShadowCaster::trMatrix
 

Actual transformation matrix of the object.

Definition at line 77 of file ShadowCaster.h.

Referenced by SoShadowVolume::create(), getMatrix(), and getTransformationMatrix().

SbMatrix CShadowCaster::trMatrixOld
 

Previous transformation matrix of the object.

Definition at line 79 of file ShadowCaster.h.

Referenced by SoShadowVolume::create(), and getTransformationMatrix().

SoPath* CShadowCaster::path
 

Path from scene root to the object node.

Definition at line 81 of file ShadowCaster.h.

Referenced by CShadowManager::addObject(), and CShadowCaster().

SoSeparator* CShadowCaster::objectRoot
 

Shadow casting object root node.

Definition at line 83 of file ShadowCaster.h.

Referenced by getObjectNode().

CShadowManager* CShadowCaster::manager [private]
 

Pointer to shadow manager.

Definition at line 87 of file ShadowCaster.h.

Referenced by createShadowVolumes(), and showFaceModel().

int CShadowCaster::nameIndex [private]
 

Object name index.

Definition at line 89 of file ShadowCaster.h.

Referenced by CShadowCaster(), getCasterName(), and setCasterName().

SoPathSensor* CShadowCaster::moveSensor [private]
 

Sensor of object movement.

Definition at line 91 of file ShadowCaster.h.

Referenced by CShadowCaster(), getMoveSensor(), setMoveSensor(), and ~CShadowCaster().

SoNodeSensor* CShadowCaster::shapeSensor [private]
 

Sensor of object change.

Definition at line 93 of file ShadowCaster.h.

Referenced by CShadowCaster(), getShapeSensor(), setShapeSensor(), and ~CShadowCaster().

bool CShadowCaster::hasMoved [private]
 

Object move flag.

Definition at line 95 of file ShadowCaster.h.

Referenced by CShadowCaster(), moved(), and setMoved().


The documentation for this class was generated from the following files:
Generated on Wed May 3 18:32:07 2006 for Shadow Engine by  doxygen 1.4.6-NO