| ## Public API Reference

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

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

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

[legend]
List of all members.

## Public Member Functions
virtual const csArray< iLightSectorInfluence * > & | GetRelevantLights (iMeshWrapper *logObject, int maxLights, bool desireSorting)=0
| Return all 'relevant' light/sector influence objects 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.

Main creators of instances implementing this interface:

- 3D engine

Main ways to get pointers to this interface:

- csQueryRegistry<iLightManager>

Main users of this interface:

- meshes

Definition at line 76 of file lightmgr.h.

## Member Function Documentation

virtual const csArray<iLightSectorInfluence*>& iLightManager::GetRelevantLights | ( | iMeshWrapper * | logObject,
|  | int | maxLights,
|  | bool | desireSorting |
| ) |  |  | `[pure virtual]`

Return all 'relevant' light/sector influence objects 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.
  | 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:

- iengine/lightmgr.h