Expand description
Convex hull construction and query module.
Port of box3d-cpp-reference/src/hull.c: quickhull construction, box hulls,
validate, identity, plus mass/AABB/overlap/cast query APIs. The verstable hull
map is deferred.
Structs§
- BoxHull
- Efficient box hull with embedded arrays matching C
b3BoxHull. - Hull
Data - A convex hull.
- Hull
Data View - Borrowed view of hull geometry (owned hull or box hull).
- Hull
Database - Shared hull store for a world. (b3HullMap + world->hullDatabase)
- Hull
Face - A hull face. Hulls use a half-edge data structure, so a face can be determined from a single half-edge index.
- Hull
Half Edge - Half-edge for hull data structure.
- Hull
Vertex - A hull vertex. Identified by a half-edge with this vertex as its tail.
Constants§
- BOX_
HULL_ SIZE - Size of the C
b3BoxHull. (_Static_assert in hull.c) - HULL_
DATA_ SIZE - Size of the C
b3HullDataheader. (_Static_assert in hull.c) - HULL_
VERSION - 64-bit hull version. Useful for validating serialized data. (B3_HULL_VERSION)
Functions§
- clone_
and_ transform_ hull - Clone a hull, then scale/rotate/translate it. Recomputes planes, bounds, and
bulk properties, so the result is a fully valid hull. A negative net scale
(reflection) reverses each face’s edge winding so the hull stays outward-facing.
Returns
Noneiforiginalis invalid or the transformed hull degenerates. (b3CloneAndTransformHull) - clone_
hull - Clone a hull. (b3CloneHull)
- collide_
mover_ and_ hull - Collide a capsule mover against a hull. (b3CollideMoverAndHull)
- compare_
hull_ data - Compare two hulls by C contiguous-blob equality. (b3CompareHullData)
- compute_
hull_ aabb - Compute the AABB of a hull. (b3ComputeHullAABB)
- compute_
hull_ extent - Compute the extent of a hull relative to an origin. (b3ComputeHullExtent)
- compute_
hull_ mass - Compute mass properties of a hull. (b3ComputeHullMass)
- compute_
hull_ projected_ area - Projected area of a hull onto a plane with the given direction. Fan-triangulates each face and sums max(dot(cross(e1, e2), direction), 0). (b3ComputeHullProjectedArea)
- compute_
swept_ hull_ aabb - Compute the swept AABB of a hull between two transforms. (b3ComputeSweptHullAABB)
- convert_
bytes_ to_ hull - Restore a hull from a contiguous blob. (inverse of
HullData::to_bytes) - create_
cone - Create a cone/frustum hull. (b3CreateCone)
- create_
cylinder - Create a cylinder hull. (b3CreateCylinder)
- create_
hull - Create a convex hull from a point cloud. (b3CreateHull)
- create_
rock - Create a rock-like hull from a Fibonacci lattice. (b3CreateRock)
- destroy_
hull - Destroy is a no-op for owned Rust hulls; kept for API parity. (b3DestroyHull)
- find_
hull_ support_ face - Find the support face in a direction. (b3FindHullSupportFace)
- find_
hull_ support_ vertex - Find the support vertex in a direction. (b3FindHullSupportVertex)
- get_
hull_ edges - Get hull half-edges. (collision.h: b3GetHullEdges)
- get_
hull_ faces - Get hull faces. (collision.h: b3GetHullFaces)
- get_
hull_ planes - Get hull face planes. (collision.h: b3GetHullPlanes)
- get_
hull_ points - Get hull points. (collision.h: b3GetHullPoints)
- get_
hull_ vertices - Get hull vertices. (collision.h: b3GetHullVertices)
- hash_
hull_ data - Spread the baked 32-bit content hash across 64 bits. (b3HashHullData)
- is_
valid_ hull - Validate hull topology and bulk properties. (b3IsValidHull)
- make_
box_ hull - Make a box as a hull. (b3MakeBoxHull)
- make_
cube_ hull - Make a cube as a hull. (b3MakeCubeHull)
- make_
offset_ box_ hull - Make an offset box as a hull. (b3MakeOffsetBoxHull)
- make_
scaled_ box_ hull - Make a scaled box hull. (b3MakeScaledBoxHull)
- make_
transformed_ box_ hull - Make a transformed box as a hull. (b3MakeTransformedBoxHull)
- overlap_
hull - Test overlap between a hull and a shape proxy. (b3OverlapHull)
- ray_
cast_ hull - Ray cast versus hull shape in local space. (b3RayCastHull)
- scale_
box - Scale a box’s half-widths and transform by a post-scale. (b3ScaleBox)
- shape_
cast_ hull - Shape cast versus a hull. (b3ShapeCastHull)