LambdaHack-0.5.0.0: A game engine library for roguelike dungeon crawlers

Safe HaskellNone
LanguageHaskell2010

Game.LambdaHack.Server.Fov.Permissive

Description

PFOV (Permissive Field of View) clean-room reimplemented based on the algorithm described in http://roguebasin.roguelikedevelopment.org/index.php?title=Precise_Permissive_Field_of_View, though the general structure is more influenced by recursive shadow casting, as implemented in Shadow.hs. In the result, this algorithm is much faster than the original algorithm on dense maps, since it does not scan areas blocked by shadows.

Synopsis

Documentation

scan Source #

Arguments

:: (Bump -> Bool)

clear tile predicate

-> [Bump] 

Calculates the list of tiles, in Bump coordinates, visible from (0, 0).

dline :: Bump -> Bump -> Line Source #

Create a line from two points. Debug: check if well-defined.

dsteeper :: Bump -> Bump -> Bump -> Bool Source #

Compare steepness of (p1, f) and (p2, f). Debug: Verify that the results of 2 independent checks are equal.

intersect :: Line -> Distance -> (Int, Int) Source #

The Y coordinate, represented as a fraction, of the intersection of a given line and the line of diagonals of squares at distance d from (0, 0).

debugSteeper :: Bump -> Bump -> Bump -> Bool Source #

Debug functions for PFOV:

Debug: calculate steeper for PFOV in another way and compare results.

debugLine :: Line -> (Bool, String) Source #

Debug: checks postconditions of borderLine.