Class Index | File Index

Classes


Class ROT.Lighting

Lighting computation, based on a traditional FOV for multiple light sources and multiple passes.
Defined in: <rot.js>.

Class Summary
Constructor Attributes Constructor Name and Description
 
ROT.Lighting(reflectivityCallback, options)
Method Summary
Method Attributes Method Name and Description
 
compute(lightingCallback)
Compute the lighting
 
Reset the pre-computed topology values.
 
setFOV(fov)
Set the used Field-Of-View algo
 
setLight(x, y, color)
Set (or remove) a light source
 
setOptions(options)
Adjust options at runtime
Class Detail
ROT.Lighting(reflectivityCallback, options)
Parameters:
{function} reflectivityCallback
Callback to retrieve cell reflectivity (0..1)
{object} options Optional
{int} options.passes Optional, Default: 1
Number of passes. 1 equals to simple FOV of all light sources, >1 means a *highly simplified* radiosity-like algorithm.
{int} options.emissionThreshold Optional, Default: 100
Cells with emissivity > threshold will be treated as light source in the next pass.
{int} options.range Optional, Default: 10
Max light range
Method Detail
compute(lightingCallback)
Compute the lighting
Parameters:
{function} lightingCallback
Will be called with (x, y, color) for every lit cell

reset()
Reset the pre-computed topology values. Call whenever the underlying map changes its light-passability.

setFOV(fov)
Set the used Field-Of-View algo
Parameters:
{ROT.FOV} fov

setLight(x, y, color)
Set (or remove) a light source
Parameters:
{int} x
{int} y
{null || string || number[3]} color

setOptions(options)
Adjust options at runtime
Parameters:
{object} options Optional
See:
ROT.Lighting

Documentation generated by JsDoc Toolkit 2.4.0 on Fri Mar 08 2013 11:07:30 GMT+0100 (CET)