@Beta public class RayCastingFOV extends java.lang.Object implements FOVSolver
Constructor and Description |
---|
RayCastingFOV()
Builds a new ray tracing fov solver with the default step size.
|
RayCastingFOV(float step,
float gap)
Builds a new ray tracing fov solver.
|
Modifier and Type | Method and Description |
---|---|
float[][] |
calculateFOV(float[][] resistanceMap,
int startx,
int starty,
float radius)
Calculates the Field of View in the same manner as the version with more
parameters.
|
float[][] |
calculateFOV(float[][] resistanceMap,
int startx,
int starty,
float force,
float decay,
RadiusStrategy radiusStrategy)
Calculates the Field Of View for the provided map from the given x, y
coordinates.
|
public RayCastingFOV(float step, float gap)
step
- the length along the ray to traverse in each stepgap
- the offset from the center the lines will be tracedpublic RayCastingFOV()
public float[][] calculateFOV(float[][] resistanceMap, int startx, int starty, float force, float decay, RadiusStrategy radiusStrategy)
FOVSolver
calculateFOV
in interface FOVSolver
resistanceMap
- the grid of cells to calculate onstartx
- the horizontal component of the starting locationstarty
- the vertical component of the starting locationforce
- the power of the raydecay
- how much the light is reduced for each whole integer step in
distanceradiusStrategy
- provides a means to calculate the radius as desiredpublic float[][] calculateFOV(float[][] resistanceMap, int startx, int starty, float radius)
FOVSolver
calculateFOV
in interface FOVSolver
resistanceMap
- the grid of cells to calculate on