Safe Haskell | Safe-Infered |
---|

This module provides an axis aligned bounding box based on `Vec`

s.

- data AABB = AABB {}
- aabbTransform :: Mat44 Float -> AABB -> AABB
- testAABBprojection :: Mat44 Float -> AABB -> Intersection
- data Intersection
- = Inside
- | Intersecting
- | Outside

# Documentation

An axis aligned bounding box.

aabbTransform :: Mat44 Float -> AABB -> AABBSource

Transforms an 'AABB* using a 4x4 matrix. Note that this may grow the AABB and is not associative with matrix multiplication, i.e.

(m2 `multmm` m1) `aabbTransform` aabb

is usually not the same as

m2 `aabbTransform` (m1 `aabbTransform` aabb)

(The former is preferred as it minimizes the growing of the AABB).

testAABBprojection :: Mat44 Float -> AABB -> IntersectionSource

Try if an `AABB`

is inside a projection frustum. The AABB must be defined in the same vector space as the matrix, e.g. use the model-view-projection matrix for model-local aabb's.