Skip to main content

Module collision

Module collision 

Source
Expand description

Collision utilities for physics simulation.

Provides AABB-vs-block collision detection and ray casting against the block grid. These are the building blocks for the physics system and future gameplay mechanics (line-of-sight, block targeting).

Structs§

Aabb
An axis-aligned bounding box in world coordinates.
RayHit
Result of a ray cast against the block grid.

Functions§

check_overlap
Checks if an AABB overlaps any solid block in the world.
ray_cast
Casts a ray through the world and returns the first solid block hit.
resolve_movement
Resolves movement of an AABB against solid blocks.