Expand description
Axis-aligned box shape.
Structs§
- BoxShape
- An axis-aligned box defined by half-extents.
Functions§
- obb_
aabb_ bounds - Compute the AABB bounds (lo, hi) of an OBB in world space.
- obb_
closest_ point - Closest point on the surface of an OBB to a world-space point
p.center: OBB center in world space.half_extents: half-widths along each local axis.rot: rotation matrix (row i = world direction of local axis i). Returns world-space closest point (may be on interior ifpis inside). - obb_
edges - Returns all 12 edges of the OBB in world space as (start, end) pairs.
- obb_
face_ centers - Returns the 6 face centers of the OBB in world space. Order: +local_x, -local_x, +local_y, -local_y, +local_z, -local_z.
- obb_
inertia_ tensor - Inertia tensor of an OBB in its own local frame (diagonal matrix).
half_extents: half-widths along each local axis. Returns a 3×3 row-major array. - obb_
inertia_ tensor_ rotated - Inertia tensor of an OBB transformed to world frame via rotation matrix
rot.rotmaps local axes to world axes (each row is a world-space basis vector). Uses I_world = R * I_local * R^T. - obb_
plane_ distance - Signed distance from the OBB to a plane (ax + by + cz + d = 0).
Returns
(min_signed_dist, max_signed_dist)for the OBB interval projected on the plane normal. Ifmin < 0 && max > 0, the OBB straddles the plane. - obb_
projection_ extent - Compute the projection half-extent of an OBB onto a world-space axis. This is the sum of |half_i * dot(rot_col_i, axis)| over i.
- obb_
ray_ intersection - Ray-OBB intersection using the slab method in local OBB space.
ray_origin,ray_dir: world-space ray.center,half_extents,rot: OBB parameters. Returns the hit parametertif intersection within[0, max_toi], elseNone. - obb_
support_ fn - GJK support function for an OBB: returns the farthest vertex in
direction. - obb_
vertices - Returns all 8 vertices of the OBB in world space.