Safe Haskell | None |
---|---|
Language | Haskell2010 |
Aabb is "Axis-aligned bounding box". The "broadphase" of collision detection is a conservative estimate of which bodies may be in contact.
- data Bounds = Bounds {}
- data Aabb = Aabb {}
- boundsOverlap :: Bounds -> Bounds -> Bool
- aabbCheck :: Aabb -> Aabb -> Bool
- hullToAabb :: ConvexHull -> Aabb
- circleToAabb :: Circle -> Aabb
- toAabb :: Shape -> Aabb
- toAabb_ :: P2 -> Aabb
- mergeAabb :: Aabb -> Aabb -> Aabb
- mergeRange :: Bounds -> Bounds -> Bounds
- toAabbs :: (Unbox k, PhysicsWorld k w o) => w -> Vector (k, Aabb)
- toTaggedAabbs :: (Unbox k, Unbox tag, PhysicsWorld k w o) => (o -> tag) -> w -> Vector (k, Aabb, tag)
- unorderedPairs :: Int -> [(Int, Int)]
- culledKeys :: (Unbox k, PhysicsWorld k w o, WorldObj a ~ o) => w -> Descending (k, k)
Documentation
An interval, bounded above and below
An axis-aligned bounding box (AABB)
hullToAabb :: ConvexHull -> Aabb Source #
Find the AABB for a convex polygon.
circleToAabb :: Circle -> Aabb Source #
mergeRange :: Bounds -> Bounds -> Bounds Source #
Find the interval that contains a pair of intervals.
toAabbs :: (Unbox k, PhysicsWorld k w o) => w -> Vector (k, Aabb) Source #
Find the AABB for each object in a world.
Build a vector of these AABBs, each identified by its key in the world.
Objects are ordered using the world's traversal order
toTaggedAabbs :: (Unbox k, Unbox tag, PhysicsWorld k w o) => (o -> tag) -> w -> Vector (k, Aabb, tag) Source #
Given a world:
- Find the AABB for each object.
- Extract a tag from each object.
- Build a vector of these tagged AABBs, each identified by its key in the world.
Objects are ordered using the world's traversal order
culledKeys :: (Unbox k, PhysicsWorld k w o, WorldObj a ~ o) => w -> Descending (k, k) Source #
Find pairs of objects with overlapping AABBs.
Note: Pairs of static objects are excluded.
These pairs are in descending order according to unorderedPairs
, where "ascending" is the world's traversal order.