ShadowCaster Class Reference

#include <shadowCaster.h>

List of all members.

Public Member Functions

 ShadowCaster ()
 ~ShadowCaster ()
void render (SceneObject *parentObject, TSShapeInstance *shapeInstance, F32 camDist, bool forceUpdate=false)
 Renders all shadows that need rendering.
void cleanupUnusedShadows (U32 time)
 Cleans up all shadows which haven't been used in a while.
void clearAllShadows ()
 Deletes all shadows.

Private Member Functions

ShadowMultimapgetFirstShadowEntry ()
 Gets the first entry in the shadow multimap for looping through the whole thing.
void clearShadowMultimap ()
 Deletes all shadows in our multimap.
ShadowBaselookupShadow (SceneObject *parentObject, LightInfo *light, TSShapeInstance *shapeInstance)
 Finds a shadow for the given shape and light in our multimap, or creates one if necessary.
ShadowBasecreateNewShadow (SceneObject *parentObject, LightInfo *light, TSShapeInstance *shapeInstance)
 Creates a new shadow (Factory).
U32 lightToHash (LightInfo *light)
 Converts a LightInfo* to a hash lookup.
LightInfohashToLight (U32 hash)
 Converts a hash lookup to a LightInfo*.

Private Attributes

ShadowMultimap mShadowMultimap
 Multimap of all of our shadows.
bool mIsRegistered
 Have we registered with ShadowCasterManager.
U32 mLastRenderTime
 When we last rendered a shadow.


Constructor & Destructor Documentation

ShadowCaster::ShadowCaster (  ) 

ShadowCaster::~ShadowCaster (  ) 


Member Function Documentation

ShadowMultimap* ShadowCaster::getFirstShadowEntry (  )  [private]

Gets the first entry in the shadow multimap for looping through the whole thing.

void ShadowCaster::clearShadowMultimap (  )  [private]

Deletes all shadows in our multimap.

ShadowBase* ShadowCaster::lookupShadow ( SceneObject parentObject,
LightInfo light,
TSShapeInstance shapeInstance 
) [private]

Finds a shadow for the given shape and light in our multimap, or creates one if necessary.

ShadowBase* ShadowCaster::createNewShadow ( SceneObject parentObject,
LightInfo light,
TSShapeInstance shapeInstance 
) [private]

Creates a new shadow (Factory).

U32 ShadowCaster::lightToHash ( LightInfo light  )  [inline, private]

Converts a LightInfo* to a hash lookup.

LightInfo* ShadowCaster::hashToLight ( U32  hash  )  [inline, private]

Converts a hash lookup to a LightInfo*.

void ShadowCaster::render ( SceneObject parentObject,
TSShapeInstance shapeInstance,
F32  camDist,
bool  forceUpdate = false 
)

Renders all shadows that need rendering.

void ShadowCaster::cleanupUnusedShadows ( U32  time  ) 

Cleans up all shadows which haven't been used in a while.

void ShadowCaster::clearAllShadows (  ) 

Deletes all shadows.


Member Data Documentation

Multimap of all of our shadows.

Have we registered with ShadowCasterManager.

When we last rendered a shadow.