Show / Hide Table of Contents

Class RecursiveShadowcastingSenseSource

A sense source which performs its spreading calculations by using a recursive shadowcasting algorithm.

Inheritance
object
SenseSourceBase
RecursiveShadowcastingSenseSource
Implements
ISenseSource
Inherited Members
SenseSourceBase.Size
SenseSourceBase.Center
SenseSourceBase.ResultViewBacking
SenseSourceBase.AngleInternal
SenseSourceBase.Reset()
SenseSourceBase.CalculateLight()
SenseSourceBase.SetResistanceMap(IGridView<double>)
SenseSourceBase.ToString()
SenseSourceBase.ResultView
SenseSourceBase.Decay
SenseSourceBase.Position
SenseSourceBase.Radius
SenseSourceBase.DistanceCalc
SenseSourceBase.Enabled
SenseSourceBase.IsAngleRestricted
SenseSourceBase.Intensity
SenseSourceBase.Angle
SenseSourceBase.Span
SenseSourceBase.ResistanceView
SenseSourceBase.RadiusChanged
object.GetType()
object.MemberwiseClone()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
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 Source

RecursiveShadowcastingSenseSource(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.

View Source

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 -- angle / 2 degrees are included on either side of the cone's center line.

double intensity

The starting intensity value of the source. Defaults to 1.0.

View Source

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.

View Source

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 -- angle / 2 degrees are included on either side of the cone's center line.

double intensity

The starting intensity value of the source. Defaults to 1.0.

Methods

View Source

OnCalculate()

Performs the spread calculations via recursive shadowcasting.

Declaration
public override void OnCalculate()
Overrides
SenseSourceBase.OnCalculate()

Implements

ISenseSource

Extension Methods

Utility.Yield<T>(T)
  • View Source
In this article
Back to top Generated by DocFX