@Beta public class ThreadedFOVSolver extends java.lang.Object implements FOVSolver, java.lang.Runnable
Constructor and Description |
---|
ThreadedFOVSolver(FOVSolver solver)
Simply wraps a solver in order to thread it.
|
ThreadedFOVSolver(FOVSolver solver,
int startx,
int starty,
float radius)
Builds a FOVSolver which will use the default RadiusStrategy for
calculations when used as a standard Thread.
|
ThreadedFOVSolver(FOVSolver solver,
int startx,
int starty,
float force,
float decay,
RadiusStrategy strategy)
Builds a FOVSolver which will use the full information for calculations
when run as a Thread.
|
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.
|
float[][] |
getLightMap()
Returns the last calculated light map.
|
boolean |
isCalculating() |
void |
run() |
public ThreadedFOVSolver(FOVSolver solver, int startx, int starty, float force, float decay, RadiusStrategy strategy)
solver
- startx
- starty
- force
- decay
- strategy
- public ThreadedFOVSolver(FOVSolver solver, int startx, int starty, float radius)
solver
- startx
- starty
- radius
- public ThreadedFOVSolver(FOVSolver solver)
solver
- 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 onpublic void run()
run
in interface java.lang.Runnable
public boolean isCalculating()
public float[][] getLightMap()