Class ROT.FOV.RecursiveShadowcasting
Extends
ROT.FOV.
Recursive shadowcasting algorithm
Currently only supports 4/8 topologies, not hexagonal.
Based on Peter Harkins' implementation of Björn Bergström's algorithm described here: http://www.roguebasin.com/index.php?title=FOV_using_recursive_shadowcasting
Defined in: <rot.js>.
Constructor Attributes | Constructor Name and Description |
---|---|
ROT.FOV.RecursiveShadowcasting(lightPassesCallback, options)
|
Field Attributes | Field Name and Description |
---|---|
<static> |
ROT.FOV.RecursiveShadowcasting.OCTANTS
Octants used for translating recursive shadowcasting offsets
|
Method Attributes | Method Name and Description |
---|---|
compute(x, y, R, callback)
Compute visibility for a 360-degree circle
|
|
compute180(x, y, R, dir, callback)
Compute visibility for a 180-degree arc
|
|
compute90(x, y, R, dir, callback)
Compute visibility for a 90-degree arc
|
Class Detail
ROT.FOV.RecursiveShadowcasting(lightPassesCallback, options)
- Parameters:
- lightPassesCallback
- options
Field Detail
<static>
ROT.FOV.RecursiveShadowcasting.OCTANTS
Octants used for translating recursive shadowcasting offsets
Method Detail
compute(x, y, R, callback)
Compute visibility for a 360-degree circle
- Parameters:
- {int} x
- {int} y
- {int} R
- Maximum visibility radius
- {function} callback
compute180(x, y, R, dir, callback)
Compute visibility for a 180-degree arc
- Parameters:
- {int} x
- {int} y
- {int} R
- Maximum visibility radius
- {int} dir
- Direction to look in (expressed in a ROT.DIRS value);
- {function} callback
compute90(x, y, R, dir, callback)
Compute visibility for a 90-degree arc
- Parameters:
- {int} x
- {int} y
- {int} R
- Maximum visibility radius
- {int} dir
- Direction to look in (expressed in a ROT.DIRS value);
- {function} callback