SoShadowCaster 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 SoShadowCaster.h.

Public Member Functions

 SoShadowCaster (CShadowManager *sm, SoSeparator *or)
 Constructor.
 ~SoShadowCaster ()
 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

SoShadowCaster::SoShadowCaster 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 SoShadowCaster.cpp.

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

SoShadowCaster::~SoShadowCaster  ) 
 

Destructor.

Definition at line 61 of file SoShadowCaster.cpp.

References moveSensor, and shapeSensor.


Member Function Documentation

bool SoShadowCaster::getTransformationMatrix  )  [private]
 

Finds and updates model's transformation matrix.

Stores previous one before.

Definition at line 202 of file SoShadowCaster.cpp.

References ONDEBUG, trMatrix, and trMatrixOld.

Referenced by createShadowVolumes(), and SoShadowCaster().

SoSeparator * SoShadowCaster::getObjectNode  ) 
 

Returns object node pointer.

Definition at line 73 of file SoShadowCaster.cpp.

References objectRoot.

CObjectModel * SoShadowCaster::getObjectModel  ) 
 

Set object move flag.

Definition at line 240 of file SoShadowCaster.cpp.

References objectModel.

Referenced by SoShadowVolume::create().

SbMatrix * SoShadowCaster::getMatrix  ) 
 

Set object move flag.

Definition at line 231 of file SoShadowCaster.cpp.

References trMatrix.

Referenced by SoShadowVolume::create().

void SoShadowCaster::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 SoShadowCaster.cpp.

References nameIndex, and ONDEBUG.

Referenced by CShadowManager::addObject().

int SoShadowCaster::getCasterName  ) 
 

Gets caster name index.

Returns:
int Index (name) of the object.

Definition at line 100 of file SoShadowCaster.cpp.

References nameIndex.

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

void SoShadowCaster::setMoveSensor SoPathSensor *  sensor  ) 
 

Sets object move sensor.

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

Definition at line 111 of file SoShadowCaster.cpp.

References moveSensor.

Referenced by CShadowManager::addObject().

void SoShadowCaster::setShapeSensor SoNodeSensor *  sensor  ) 
 

Sets object moveSensor geom.

change.

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

Definition at line 133 of file SoShadowCaster.cpp.

References shapeSensor.

Referenced by CShadowManager::addObject().

SoPathSensor * SoShadowCaster::getMoveSensor  ) 
 

Gets object move sensor.

Returns:
SoPathSensor * pointer to the object move sensor.

Definition at line 122 of file SoShadowCaster.cpp.

References moveSensor.

SoNodeSensor * SoShadowCaster::getShapeSensor  ) 
 

Gets object shape sensor.

Returns:
SoNodeSensor * Pointer to the object shape sensor.

Definition at line 144 of file SoShadowCaster.cpp.

References shapeSensor.

void SoShadowCaster::createFaceModel  ) 
 

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

Definition at line 153 of file SoShadowCaster.cpp.

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

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

void SoShadowCaster::showFaceModel  ) 
 

Adds object model to the scene graph.

For debug purposes only.

Definition at line 167 of file SoShadowCaster.cpp.

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

Referenced by createFaceModel().

void SoShadowCaster::createShadowVolumes  ) 
 

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

Definition at line 271 of file SoShadowCaster.cpp.

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

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

void SoShadowCaster::setMoved bool  m  ) 
 

Set object move flag.

Parameters:
m Move flag.

Definition at line 251 of file SoShadowCaster.cpp.

References hasMoved.

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

bool SoShadowCaster::moved  ) 
 

Return object move flag.

Returns:
True if object has moved.

Definition at line 262 of file SoShadowCaster.cpp.

References hasMoved.

Referenced by SoShadowVolume::create().


Member Data Documentation

CObjectModel* SoShadowCaster::objectModel
 

Object model.

Definition at line 75 of file SoShadowCaster.h.

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

SbMatrix SoShadowCaster::trMatrix
 

Actual transformation matrix of the object.

Definition at line 77 of file SoShadowCaster.h.

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

SbMatrix SoShadowCaster::trMatrixOld
 

Previous transformation matrix of the object.

Definition at line 79 of file SoShadowCaster.h.

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

SoPath* SoShadowCaster::path
 

Path from scene root to the object node.

Definition at line 81 of file SoShadowCaster.h.

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

SoSeparator* SoShadowCaster::objectRoot
 

Shadow casting object root node.

Definition at line 83 of file SoShadowCaster.h.

Referenced by getObjectNode().

CShadowManager* SoShadowCaster::manager [private]
 

Pointer to shadow manager.

Definition at line 87 of file SoShadowCaster.h.

Referenced by createShadowVolumes(), and showFaceModel().

int SoShadowCaster::nameIndex [private]
 

Object name index.

Definition at line 89 of file SoShadowCaster.h.

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

SoPathSensor* SoShadowCaster::moveSensor [private]
 

Sensor of object movement.

Definition at line 91 of file SoShadowCaster.h.

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

SoNodeSensor* SoShadowCaster::shapeSensor [private]
 

Sensor of object change.

Definition at line 93 of file SoShadowCaster.h.

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

bool SoShadowCaster::hasMoved [private]
 

Object move flag.

Definition at line 95 of file SoShadowCaster.h.

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


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