Skip to main content

Module distance

Module distance 

Source

Structs§

DistanceInput
Input for shape_distance. (b2DistanceInput)
DistanceOutput
Output for shape_distance. (b2DistanceOutput)
SegmentDistanceResult
Result of computing the distance between two line segments. (b2SegmentDistanceResult)
ShapeCastPairInput
Input parameters for shape_cast. (b2ShapeCastPairInput)
ShapeProxy
A distance proxy used by the GJK algorithm. It encapsulates any shape. You can provide between 1 and MAX_POLYGON_VERTICES points and a radius. (b2ShapeProxy)
Simplex
Simplex from the GJK algorithm. (b2Simplex)
SimplexCache
Used to warm start the GJK simplex. If you call this function multiple times with nearby transforms this might improve performance. Otherwise you can zero initialize this. (b2SimplexCache)
SimplexVertex
Simplex vertex for debugging the GJK algorithm. (b2SimplexVertex)
Sweep
This describes the motion of a body/shape for TOI computation. Shapes are defined with respect to the body origin, which may not coincide with the center of mass. However, to support dynamics we must interpolate the center of mass position. (b2Sweep)
ToiInput
Time of impact input. (b2TOIInput)
ToiOutput
Time of impact output. (b2TOIOutput)

Enums§

ToiState
Describes the TOI output. (b2TOIState)

Functions§

get_sweep_transform
Evaluate the transform sweep at a specific time. (b2GetSweepTransform)
make_offset_proxy
Make a proxy with a transform. This is a deep copy of the points. (b2MakeOffsetProxy)
make_proxy
Make a proxy for use in overlap, shape cast, and related functions. This is a deep copy of the points. (b2MakeProxy)
segment_distance
Compute the distance between two line segments, clamping at the end points if needed. (b2SegmentDistance)
shape_cast
Perform a linear shape cast of shape B moving and shape A fixed. Determines the hit point, normal, and translation fraction. The query runs in frame A, so the hit point and normal are returned in frame A. Initially touching shapes are a miss unless can_encroach allows it. (b2ShapeCast)
shape_distance
Compute the closest points between two shapes represented as point clouds. The cache is input/output: on the first call set SimplexCache::count to zero. (b2ShapeDistance)
time_of_impact
Compute the upper bound on time before two shapes penetrate. Time is represented as a fraction between [0, max_fraction]. This uses a swept separating axis and may miss some intermediate, non-tunneling collisions. If you change the time interval, you should call this function again. (b2TimeOfImpact)