Adventure at Umalu  22nd March, 2013
Rogue-like Dungeon Crawler, written in Java
 All Classes Functions Variables Pages
Protected Member Functions | List of all members
jade.fov.ShadowCaster Class Reference
Inheritance diagram for jade.fov.ShadowCaster:
jade.fov.ViewField

Protected Member Functions

Collection< CoordinatecalcViewField (World world, int x, int y, int r)
 
Collection< CoordinatecalcViewFieldplayer (World world, int x, int y, int r)
 

Additional Inherited Members

- Public Member Functions inherited from jade.fov.ViewField
final Collection< CoordinategetViewField (World world, int x, int y, int r)
 
final Collection< CoordinategetViewFieldplayer (World world, int x, int y, int r)
 
final Collection< CoordinategetViewField (World world, Coordinate coord, int r)
 

Detailed Description

Uses shadow casting to quickly calculate a view field. Shadow casting is more complicated than ray casting, but will only visit each tile once. This gives it a significant advantage over ray casting which revisits cells multiple times when the view field is large. For this reason, shadow casting is much more popular than the simpler ray casting.

Member Function Documentation

Collection<Coordinate> jade.fov.ShadowCaster.calcViewField ( World  world,
int  x,
int  y,
int  r 
)
protectedvirtual

Calculates the field of view on the given

World

from the given (x, y) coordinates with the specified radius.

Parameters
worldthe
World
on which field of view is being calculated
xthe x value of the coordinate being queried
ythe y value of the coordinate being queried
rthe radius of the field of view
Returns
the field of view on world from (x, y)

Implements jade.fov.ViewField.


The documentation for this class was generated from the following file: