gloss-algorithms-1.13.0.2: Data structures and algorithms for working with 2D graphics.

Safe HaskellNone
LanguageHaskell2010

Graphics.Gloss.Algorithms.RayCast

Description

Various ray casting algorithms.

Synopsis

Documentation

castSegIntoCellularQuadTree Source #

Arguments

:: Point

(P1) Starting point of seg.

-> Point

(P2) Final point of seg.

-> Extent

Extent convering the whole tree.

-> QuadTree a

The tree.

-> Maybe (Point, Extent, a)

Intersection point, extent of cell, value of cell (if any).

The quadtree contains cells of unit extent (NetHack style). Given a line segement (P1-P2) through the tree, get the cell closest to P1 that intersects the segment, if any.

traceSegIntoCellularQuadTree Source #

Arguments

:: Point

(P1) Starting point of seg.

-> Point

(P2) Final point of seg.

-> Extent

Extent covering the whole tree.

-> QuadTree a

The tree.

-> [(Point, Extent, a)]

Intersection point, extent of cell, value of cell.

The quadtree contains cells of unit extent (NetHack style). Given a line segment (P1-P2) through the tree, return the list of cells that intersect the segment.