Class RecursiveShadowcastingSenseSource
A sense source which performs its spreading calculations by using a recursive shadowcasting algorithm.
Implements
Inherited Members
Namespace: GoRogue.SenseMapping.Sources
Assembly: GoRogue.dll
Syntax
public class RecursiveShadowcastingSenseSource : SenseSourceBase, ISenseSource
Remarks
Any location on the resistance map which is not fully blocking (eg. has a value less than the source's Intensity) is considered to be fully transparent, because this implementation of shadow-casting is an on-off algorithm.
This calculation is faster but obviously doesn't offer support for partial resistance. It may be useful when you only want a rough light approximation, or where your resistance map is on-off anyway.
Constructors
View SourceRecursiveShadowcastingSenseSource(Point, double, Distance, double)
Creates a source which spreads outwards in all directions.
Declaration
public RecursiveShadowcastingSenseSource(Point position, double radius, Distance distanceCalc, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
Point | position | The position on a map that the source is located at. |
double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
double | intensity | The starting intensity value of the source. Defaults to 1.0. |
RecursiveShadowcastingSenseSource(Point, double, Distance, double, double, double)
Constructor. Creates a source which spreads only in a cone defined by the given angle and span.
Declaration
public RecursiveShadowcastingSenseSource(Point position, double radius, Distance distanceCalc, double angle, double span, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
Point | position | The position on a map that the source is located at. |
double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
double | angle | The angle in degrees that specifies the outermost center point of the cone formed by the source's values. 0 degrees points right. |
double | span | The angle, in degrees, that specifies the full arc contained in the cone formed by the source's values --
|
double | intensity | The starting intensity value of the source. Defaults to 1.0. |
RecursiveShadowcastingSenseSource(int, int, double, Distance, double)
Creates a source which spreads outwards in all directions.
Declaration
public RecursiveShadowcastingSenseSource(int positionX, int positionY, double radius, Distance distanceCalc, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
int | positionX | The X-value of the position on a map that the source is located at. |
int | positionY | The Y-value of the position on a map that the source is located at. |
double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
double | intensity | The starting intensity value of the source. Defaults to 1.0. |
RecursiveShadowcastingSenseSource(int, int, double, Distance, double, double, double)
Constructor. Creates a source which spreads only in a cone defined by the given angle and span.
Declaration
public RecursiveShadowcastingSenseSource(int positionX, int positionY, double radius, Distance distanceCalc, double angle, double span, double intensity = 1)
Parameters
Type | Name | Description |
---|---|---|
int | positionX | The x-value for the position on a map that the source is located at. |
int | positionY | The y-value for the position on a map that the source is located at. |
double | radius | The maximum radius of the source -- this is the maximum distance the source values will emanate, provided the area is completely unobstructed. |
Distance | distanceCalc | The distance calculation used to determine what shape the radius has (or a type implicitly convertible to Distance, such as Radius). |
double | angle | The angle in degrees that specifies the outermost center point of the cone formed by the source's values. 0 degrees points right. |
double | span | The angle, in degrees, that specifies the full arc contained in the cone formed by the source's values --
|
double | intensity | The starting intensity value of the source. Defaults to 1.0. |
Methods
View SourceOnCalculate()
Performs the spread calculations via recursive shadowcasting.
Declaration
public override void OnCalculate()