![]() |
Adventure at Umalu
22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
|
Public Member Functions | |
RayCaster () | |
![]() | |
final Collection< Coordinate > | getViewField (World world, int x, int y, int r) |
final Collection< Coordinate > | getViewFieldplayer (World world, int x, int y, int r) |
final Collection< Coordinate > | getViewField (World world, Coordinate coord, int r) |
Protected Member Functions | |
Collection< Coordinate > | calcViewField (World world, int x, int y, int r) |
Collection< Coordinate > | calcViewFieldplayer (World world, int x, int y, int r) |
Uses a simple raycasting algorithm to compute field of view. This algorithm works by sending digital line rays to each point on the outside of the view radius. This algorithm is very simple, and therefore can often be very fast, especially if the radius is small, or the map is very closed. However, on large and open maps the algorithm results in inefficiencies as tiles close the origin of the view field are rechecked many times over.
jade.fov.RayCaster.RayCaster | ( | ) |
|
protectedvirtual |
Calculates the field of view on the given
from the given (x, y) coordinates with the specified radius.
world | the World
|
x | the x value of the coordinate being queried |
y | the y value of the coordinate being queried |
r | the radius of the field of view |
Implements jade.fov.ViewField.