Skip to main content

Module query

Module query 

Source
Expand description

Broad-phase queries, casts, and character-mover helpers.

  • AABB and shape overlap: collect matching shape ids, reuse caller-owned buffers, or visit hits without a result container.
  • Ray casts: closest or all hits along a path.
  • Shape overlap / casting: build a temporary proxy from points + radius (accepts Into<Vec2> points).
  • Offset proxies: apply translation + rotation to the proxy for queries in local frames.
  • Character mover helpers: cast a capsule mover, collect collision planes, solve planes, and clip velocity.

Note: Box2D proxies support at most B2_MAX_POLYGON_VERTICES points (8). Extra points are ignored.

Filters: use QueryFilter to restrict categories/masks.

Structs§

Aabb
Axis-aligned bounding box
CollisionPlane
Collision plane input for solve_planes and clip_vector.
MoverPlaneResult
Result item returned by collide_mover.
Plane
A collision plane used by Box2D’s character mover helpers.
PlaneSolverResult
Result returned by solve_planes.
QueryFilter
Filter for queries
RayResult
Result of a closest ray cast

Functions§

clip_vector
Clip a velocity or movement vector against solved collision planes.
solve_planes
Solve the translation that best satisfies the supplied mover collision planes.
try_clip_vector
Clip a velocity or movement vector against solved collision planes.
try_solve_planes
Solve the translation that best satisfies the supplied mover collision planes.