CrystalSpace

Public API Reference

Main Page | Modules | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

iLightManager Struct Reference
[Lighting]

An engine (3D or iso) can implement this interface for the benefit of mesh objects so that they can request lighting information from the engine. More...

#include <iengine/lightmgr.h>

Inheritance diagram for iLightManager:

iBase List of all members.

Public Member Functions

virtual const csArray< iLight * > & GetRelevantLights (iBase *logObject, int maxLights, bool desireSorting)=0
 Return all 'relevant' lights that hit this object.

Detailed Description

An engine (3D or iso) can implement this interface for the benefit of mesh objects so that they can request lighting information from the engine.

The 'logObject' parameter given to these functions is the logical parent that is set in the mesh objects. The engine must attempt to give this information as efficiently as possible. That means only recalculating this lighting information when needed (i.e. light moves, object moves, ...).

The engine registers an implementation of this object in the object registry with the "iLightManager" name.

Definition at line 47 of file lightmgr.h.


Member Function Documentation

virtual const csArray<iLight*>& iLightManager::GetRelevantLights iBase logObject,
int  maxLights,
bool  desireSorting
[pure virtual]
 

Return all 'relevant' lights that hit this object.

Depending on implementation in the engine this can simply mean a list of all lights that affect the object or it can be a list of the N most relevant lights (with N a parameter set by the user on that object).

Parameters:
logObject logObject is the logical parent for the mesh object as set by the mesh object creator.
maxLights maxLights is the maximum number of lights that you (as the caller of this function) are interested in. Even with this set the light manager may still return an array containing more lights. You just have to ignore the additional lights then. If you don't want to limit the number of lights you can set maxLights to -1.
desireSorting if this is true then you will get a list sorted on light relevance. Light relevance is a function of influence radius, and intensity. If you don't need sorting then don't set this as it will decrease performance somewhat.


The documentation for this struct was generated from the following file:
Generated for Crystal Space by doxygen 1.3.9.1