iLightManager Struct Reference (Crystal Space 2.0 Public API Reference)

| ## Public API Reference

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions
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:

List of all members.

## Public Member Functions
virtual void | FreeInfluenceArray (csLightInfluence *Array)=0
| Free a light influence array earlier allocated by GetRelevantLights.
virtual void | GetRelevantLights (iMeshWrapper *meshObject, iLightInfluenceArray *lightArray, int maxLights, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' light that hit this object.
virtual void | GetRelevantLights (iMeshWrapper *meshObject, iLightInfluenceCallback *lightCallback, int maxLights, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' light that hit this object.
virtual void | GetRelevantLights (iSector *sector, iLightInfluenceArray *lightArray, int maxLights, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights for a given sector.
virtual void | GetRelevantLights (iSector *sector, iLightInfluenceCallback *lightCallback, int maxLights, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights for a given sector.
virtual void | GetRelevantLights (iSector *sector, const csBox3 &boundingBox, iLightInfluenceArray *lightArray, int maxLights, const csReversibleTransform *bboxToWorld=0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights that intersects a giving bounding box within a specified sector.
virtual void | GetRelevantLights (iSector *sector, const csBox3 &boundingBox, iLightInfluenceCallback *lightCallback, int maxLights, const csReversibleTransform *bboxToWorld=0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' light/sector influence objects for a given sector.
virtual void | GetRelevantLights (iMeshWrapper *meshObject, csLightInfluence *&lightArray, size_t &numLights, size_t maxLights=(size_t)~0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' light that hit this object.
virtual void | GetRelevantLights (iSector *sector, csLightInfluence *&lightArray, size_t &numLights, size_t maxLights=(size_t)~0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights for a given sector.
virtual void | GetRelevantLights (iSector *sector, const csBox3 &boundingBox, csLightInfluence *&lightArray, size_t &numLights, size_t maxLights=(size_t)~0, const csReversibleTransform *bboxToWorld=0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights that intersects a giving bounding box within a specified sector.
virtual void | GetRelevantLightsSorted (iSector *sector, const csBox3 &boundingBox, csLightInfluence *&lightArray, size_t &numLights, size_t maxLights=(size_t)~0, const csReversibleTransform *bboxToWorld=0, uint flags=CS_LIGHTQUERY_GET_ALL)=0
| Return all 'relevant' lights that intersects a giving bounding box within a specified sector.

## 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.

Main creators of instances implementing this interface:

- 3D engine

Main ways to get pointers to this interface:

- csQueryRegistry<iLightManager>

Main users of this interface:

- render managers

Definition at line 132 of file lightmgr.h.

## Member Function Documentation

virtual void iLightManager::FreeInfluenceArray | ( | csLightInfluence * | Array | ) | `[pure virtual]`

Free a light influence array earlier allocated by GetRelevantLights.

Parameters:

  Array | The light influences array returned by GetRelevantLights().

virtual void iLightManager::GetRelevantLights | ( | iMeshWrapper * | meshObject,
|  | iLightInfluenceArray * | lightArray,
|  | int | maxLights,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' light 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 mesh wrapper.
  lightArray | lightArray is the array to fill with the relevant lights.
  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.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iMeshWrapper * | meshObject,
|  | iLightInfluenceCallback * | lightCallback,
|  | int | maxLights,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' light 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 mesh wrapper.
  lightCallback | lightCallback is a callback function to call for every encountered influencing light source.
  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.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | iLightInfluenceArray * | lightArray,
|  | int | maxLights,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights for a given sector.

Parameters:

  sector | is the sector to check for.
  lightArray | lightArray is the array to fill with the relevant lights.
  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.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | iLightInfluenceCallback * | lightCallback,
|  | int | maxLights,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights for a given sector.

Parameters:

  sector | is the sector to check for.
  lightCallback | lightCallback is a callback function to call for every encountered influencing light source.
  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.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | const csBox3 & | boundingBox,
|  | iLightInfluenceArray * | lightArray,
|  | int | maxLights,
|  | const csReversibleTransform * | bboxToWorld = `0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights that intersects a giving bounding box within a specified sector.

Parameters:

  sector | is the sector to check for.
  boundingBox | is the bounding box to use when querying lights.
  lightArray | lightArray is the array to fill with the relevant lights.
  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.
  bboxToWorld | Optional transformation from bounding box to world space. 'this' space is bounding box space, 'other' space is world space. Not specifying the transformation has the same effect as specifying an identity transform.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | const csBox3 & | boundingBox,
|  | iLightInfluenceCallback * | lightCallback,
|  | int | maxLights,
|  | const csReversibleTransform * | bboxToWorld = `0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' light/sector influence objects for a given sector.

Parameters:

  sector | is the sector to check for.
  boundingBox | is the bounding box to use when querying lights.
  lightCallback | lightCallback is a callback function to call for every encountered influencing light source.
  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.
  bboxToWorld | Optional transformation from bounding box to world space. 'this' space is bounding box space, 'other' space is world space. Not specifying the transformation has the same effect as specifying an identity transform.
  flags | flags provided by csLightQueryFlags

virtual void iLightManager::GetRelevantLights | ( | iMeshWrapper * | meshObject,
|  | csLightInfluence *& | lightArray,
|  | size_t & | numLights,
|  | size_t | maxLights = `(size_t)~0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' light 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:

  meshObject | The mesh wrapper.
  boundingBox | The bounding box to be used when querying lights.
  lightArray | Returns a pointer to an arry with the influences of the relevant lights. Must be freed with FreeInfluenceArray() after use.
  numLights | The number of lights returned in lightArray.
  maxLights | The maximum number of lights that you (as the caller of this function) are interested in.
  flags | Flags provided by csLightQueryFlags.

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | csLightInfluence *& | lightArray,
|  | size_t & | numLights,
|  | size_t | maxLights = `(size_t)~0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights for a given sector.

Parameters:

  sector | is the sector to check for.
  boundingBox | The bounding box to be used when querying lights.
  lightArray | Returns a pointer to an arry with the influences of the relevant lights. Must be freed with FreeInfluenceArray() after use.
  numLights | The number of lights returned in lightArray.
  maxLights | The maximum number of lights that you (as the caller of this function) are interested in.
  flags | Flags provided by csLightQueryFlags.

virtual void iLightManager::GetRelevantLights | ( | iSector * | sector,
|  | const csBox3 & | boundingBox,
|  | csLightInfluence *& | lightArray,
|  | size_t & | numLights,
|  | size_t | maxLights = `(size_t)~0`,
|  | const csReversibleTransform * | bboxToWorld = `0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights that intersects a giving bounding box within a specified sector.

Parameters:

  sector | is the sector to check for.
  boundingBox | The bounding box to be used when querying lights.
  lightArray | Returns a pointer to an arry with the influences of the relevant lights. Must be freed with FreeInfluenceArray() after use.
  numLights | The number of lights returned in lightArray.
  maxLights | The maximum number of lights that you (as the caller of this function) are interested in.
  bboxToWorld | Optional transformation from bounding box to world space. 'this' space is bounding box space, 'other' space is world space. Not specifying the transformation has the same effect as specifying an identity transform.
  flags | Flags provided by csLightQueryFlags.

virtual void iLightManager::GetRelevantLightsSorted | ( | iSector * | sector,
|  | const csBox3 & | boundingBox,
|  | csLightInfluence *& | lightArray,
|  | size_t & | numLights,
|  | size_t | maxLights = `(size_t)~0`,
|  | const csReversibleTransform * | bboxToWorld = `0`,
|  | uint | flags = `CS_LIGHTQUERY_GET_ALL`
| ) |  | `[pure virtual]`

Return all 'relevant' lights that intersects a giving bounding box within a specified sector.

The returned lights are sorted by the intensity at the closest point on(or in) the box.

Parameters:

  sector | is the sector to check for.
  boundingBox | The bounding box to be used when querying lights.
  lightArray | Returns a pointer to an arry with the influences of the relevant lights. Must be freed with FreeInfluenceArray() after use.
  numLights | The number of lights returned in lightArray.
  maxLights | The maximum number of lights that you (as the caller of this function) are interested in.
  bboxToWorld | Optional transformation from bounding box to world space. 'this' space is bounding box space, 'other' space is world space. Not specifying the transformation has the same effect as specifying an identity transform.
  flags | Flags provided by csLightQueryFlags.

The documentation for this struct was generated from the following file:

- iengine/lightmgr.h