Safe Haskell | None |
---|---|

Language | Haskell98 |

Various ray casting algorithms.

# Documentation

castSegIntoCellularQuadTree Source #

:: 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 #

:: 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.