OgreIlluminationManager Class Reference

Implementation of IlluminationManager in an OGRE environment. More...

List of all members.

Public Member Functions

void addRenderTechniqueFactory (RenderTechniqueFactory *factory)
 registers a RenderTechniqueFactory
float getMaxJoinRadius ()
 retirieves the maximum bounding sphere radius with two SharedRuns can be joined.
void setMaxJoinRadius (float rad)
 sets the maximum bounding sphere radius with two SharedRuns can be joined.
void update (unsigned long frameNumber, RenderTarget *rt)
 The function to be called to render one frame.
void initTechniques ()
 searches for RenderTechniques in materials and creates them.
Camera * getMainCamera ()
 Returns a pointer to the player camera.
Viewport * getMainViewport ()
 Returns a pointer to the viewport attached to the player camera.
void setMainCamera (Camera *camera)
 Sets the player camera.
void setMainViewport (Viewport *viewport)
 Sets the viewport attached to the player camera.
void sharedRunSplit (SharedRuns *old, SharedRuns *new1, SharedRuns *new2)
 The function to be called when a shared run is splitted.
void sharedRunJoin (SharedRuns *old1, SharedRuns *old2, SharedRuns *newsr)
 The function to be called when two shared runs are joined.
void joinSharedRuns ()
 Joins shared runs if needed.
void addSharedRuns (SharedRuns *runs)
 Register a shared run object.
void getNearestCausticCasters (Vector3 position, std::vector< OgreSharedRuns * > *nearestcasters, unsigned int maxCount)
 Searches for the nearest object groups (SharedRuns) that are caustic casters from a given point.
void createGlobalRun (RenderingRunType runType)
 Creates a global RenderingRun of the given type.
RenderingRungetGlobalRun (RenderingRunType runType)
 Returns the global RendderingRun with the given type.
void updateGlobalRun (RenderingRunType runType, unsigned long frameNum)
 Updates a global RenderingRun with the given type.
void createPerLightRun (String lightName, RenderingRunType runType)
 Creates a RenderingRun attached to a lightsource with the given type.
RenderingRungetPerLightRun (String lightName, RenderingRunType runType)
 Retuns a RenderingRun attached to a lightsource with the given type.
void updatePerLightRun (String lightName, RenderingRunType runType, unsigned long frameNum)
 Updates a RenderingRun attached to a lightsource with the given type.

Static Public Member Functions

static OgreIlluminationManagergetSingleton ()
 Returns the one and only OgreIlluminationManager instance.

Protected Member Functions

 OgreIlluminationManager ()
 Protected constructor (OgreIlluminationManager is a singleton).
virtual ~OgreIlluminationManager ()
 Protected destructor.
void fillVisibleList (RenderQueue *rq)
 Searches for visible renderables with valid TechniqueGroups in a renderqueue.
void createTechnique (IllumTechniqueParams *params, Pass *pass, OgreRenderable *rend, OgreSharedRuns *sRuns)
 creates a specific type of RenderTechnique for a Renderable's pass.
BillboardSet * findRenderableInParticleSystem (ParticleSystem *system)
 A helper function to find the renderable object attached to a particle system (ONLY BILLBOARDSETS ARE SUPPORTED).

Protected Attributes

std::list< RenderTechniqueFactory * > techniqueFactories
 registered RenderTechniqueFactories
float maxRad
 The maximum bounding sphere radius that groupped objects ( see SharedRuns class ) can have.
Camera * mainCamera
 The camera attached to the player.
Viewport * mainViewport
 The viewport of the player camera.
VisibleFinderVisitor * visitor
 VisibleFinderVisitor instance.
std::vector< const Renderable * > visibleObjects
 Vector containing visible renderables with valid TechniqueGroups that must be refreshed.
std::list< SharedRuns * > sharedRunRoots
 List containing SharedRuns roots.
OgreSharedRuns globalSharedRuns
 Group of RenderingRuns that are used globaly.
std::map< String, OgreSharedRuns * > perLightRuns
 Stores groups of RenderingRuns that are attached to individual light sources.

Static Protected Attributes

static OgreIlluminationManagerinstance = NULL
 The one and only OgreIlluminationManager instance.


Detailed Description

Implementation of IlluminationManager in an OGRE environment.


Member Function Documentation

void OgreIlluminationManager::addSharedRuns SharedRuns runs  ) 
 

Register a shared run object.

Only called when new techniques are created.

Parameters:
runs pointer to the SharedRuns instance to add

void OgreIlluminationManager::createGlobalRun RenderingRunType  runType  ) 
 

Creates a global RenderingRun of the given type.

If a RenderingRun with the given type already exist there is nothing to do.

Parameters:
runType type enum of the RenderingRun to create

void OgreIlluminationManager::createPerLightRun String  lightName,
RenderingRunType  runType
 

Creates a RenderingRun attached to a lightsource with the given type.

Parameters:
lightName name of the lightsource
runType type enum of the RenderingRun to create

void OgreIlluminationManager::createTechnique IllumTechniqueParams *  params,
Pass *  pass,
OgreRenderable rend,
OgreSharedRuns sRuns
[protected]
 

creates a specific type of RenderTechnique for a Renderable's pass.

It searches all registered RenderTechniqueFactories.

void OgreIlluminationManager::fillVisibleList RenderQueue *  rq  )  [protected]
 

Searches for visible renderables with valid TechniqueGroups in a renderqueue.

Parameters:
rq pointer to the RenderQueue instance to search in

BillboardSet * OgreIlluminationManager::findRenderableInParticleSystem ParticleSystem *  system  )  [protected]
 

A helper function to find the renderable object attached to a particle system (ONLY BILLBOARDSETS ARE SUPPORTED).

Parameters:
system pointer to the ParticleSystem instance to search in
Returns:
pointer the connected BillboardSet instance

RenderingRun * OgreIlluminationManager::getGlobalRun RenderingRunType  runType  ) 
 

Returns the global RendderingRun with the given type.

Parameters:
runType type enum of the RenderingRun to retrieve
Returns:
pointer to the RenderingRun, NULL if no RenderingRun with the given type exists

Camera* OgreIlluminationManager::getMainCamera  )  [inline]
 

Returns a pointer to the player camera.

Returns:
pointer to the main player camera. Needed by RenderTechnique and RenderingRun classes.

Viewport* OgreIlluminationManager::getMainViewport  )  [inline]
 

Returns a pointer to the viewport attached to the player camera.

Returns:
pointer to the viewport. Needed by RenderTechnique and RenderingRun classes.

void OgreIlluminationManager::getNearestCausticCasters Vector3  position,
std::vector< OgreSharedRuns * > *  nearestcasters,
unsigned int  maxCount
 

Searches for the nearest object groups (SharedRuns) that are caustic casters from a given point.

Parameters:
position the point to obtain distances from
nearestcasters vector to put the nearest caustic caster SharedRuns to
maxCount the maximum number of nearest casters to search for

RenderingRun * OgreIlluminationManager::getPerLightRun String  lightName,
RenderingRunType  runType
 

Retuns a RenderingRun attached to a lightsource with the given type.

Parameters:
lightName name of the lightsource
runType type enum of the RenderingRun to return
Returns:
pointer to the RenderingRun, NULL if no RenderingRun with the given type exists

void OgreIlluminationManager::joinSharedRuns  ) 
 

Joins shared runs if needed.

Searches the registered shared run roots and join them if necessary (they are close enough).

void OgreIlluminationManager::setMainCamera Camera *  camera  )  [inline]
 

Sets the player camera.

Parameters:
camera pointer to the main player camera

void OgreIlluminationManager::setMainViewport Viewport *  viewport  )  [inline]
 

Sets the viewport attached to the player camera.

Parameters:
viewport pointer to the viewport

void OgreIlluminationManager::sharedRunJoin SharedRuns old1,
SharedRuns old2,
SharedRuns newsr
 

The function to be called when two shared runs are joined.

Parameters:
old1 pointer to one of the SharedRuns instance that are joined
old2 pointer to the other SharedRuns instance that are joined
newsr pointer to the resulting parent SharedRuns instance

void OgreIlluminationManager::sharedRunSplit SharedRuns old,
SharedRuns new1,
SharedRuns new2
 

The function to be called when a shared run is splitted.

Parameters:
old pointer to the SharedRuns instance that is split
new1 pointer to one of the SharedRuns instance that remain after split
new2 pointer to the other SharedRuns instance that remain after split

void OgreIlluminationManager::update unsigned long  frameNumber,
RenderTarget *  rt
 

The function to be called to render one frame.

This is the main refreshing function. It seasrches for visible objects, manages shared runs, updates render techniques and finally renders the scene to framebuffer.

Parameters:
frameNumber current framenumber
rt the rendertarget window. Needed to find the viewports that need to be refresh.

void OgreIlluminationManager::updateGlobalRun RenderingRunType  runType,
unsigned long  frameNum
 

Updates a global RenderingRun with the given type.

Parameters:
runType type enum of the RenderingRun to update
frameNum current framenumber

void OgreIlluminationManager::updatePerLightRun String  lightName,
RenderingRunType  runType,
unsigned long  frameNum
 

Updates a RenderingRun attached to a lightsource with the given type.

Parameters:
lightName name of the lightsource
runType type enum of the RenderingRun to update
frameNum current framenumber


Member Data Documentation

OgreSharedRuns OgreIlluminationManager::globalSharedRuns [protected]
 

Group of RenderingRuns that are used globaly.

Some RenderingRuns have only one instance per application (for example scene depth map). These resources are shared between all RenderTechniques.

float OgreIlluminationManager::maxRad [protected]
 

The maximum bounding sphere radius that groupped objects ( see SharedRuns class ) can have.

See also:
canJoin

joinRuns

std::map<String, OgreSharedRuns*> OgreIlluminationManager::perLightRuns [protected]
 

Stores groups of RenderingRuns that are attached to individual light sources.

These resources need separate instances for each lightsource ( for example depth shadow maps). They are grouped by the name of the lightsource.

std::list<SharedRuns*> OgreIlluminationManager::sharedRunRoots [protected]
 

List containing SharedRuns roots.

It is the IlluminationManager's task to find the SharedRuns which can be joined. Only the root SharedRuns needs to be checked.

class VisibleFinderVisitor* OgreIlluminationManager::visitor [protected]
 

VisibleFinderVisitor instance.

Used for adding visible renderables with valid TechniqueGroups to the visibleObjects vector.


The documentation for this class was generated from the following files:
Generated on Thu Apr 27 17:29:40 2006 for GameTools Illumination Module by  doxygen 1.4.6-NO