Skip to main content

Module sweep_toi

Module sweep_toi 

Source
Expand description

Time-of-impact computation on endpoint-interpolated sweeps.

Unlike cast_shapes_nonlinear, which models motion as constant velocities, this module models a timestep as a Sweep between two endpoint poses (linear center-of-mass interpolation + rotation nlerp) and computes the earliest time at which two swept shapes reach a slop-based target separation, using conservative advancement with separation functions.

NOTE: this is mostly ported from Box2D which had much better CCD quality than Rapier. TODO: see how we can combine that with nonlinear_shape_cast since they serve similar goals.

Structs§

ProxyDistanceOutput
Result of proxy_distance. All geometric quantities are expressed in the local frame of the first proxy.
SimplexCache
Warm-starting simplex cache for proxy_distance.
Sweep
Describes the motion of a rigid body over a timestep as linear interpolation between two endpoint poses: the center of mass moves on a straight line while the rotation is interpolated with a normalized lerp (nlerp).
SweepCompositeFastShape
Parameters describing the fast (moving) shape for a composite TOI query.
SweepToiOutput
The result of a sweep_time_of_impact computation.
ToiProxy
A point cloud with a radius, approximating a convex shape for sweep-based time-of-impact computations.

Enums§

SweepToiStatus
The outcome of a sweep_time_of_impact computation.

Constants§

CORE_FRACTION
Fraction of the fast shape’s minimum extent used for the initial-overlap fallback sphere.
TOI_PROXY_INLINE_POINTS
Maximum number of proxy points stored inline (cuboid corners).

Functions§

proxy_distance
Computes the distance between two point-cloud proxies, warm-started by cache.
sweep_time_of_impact
Computes the time of impact between two proxies following endpoint-interpolated sweeps.
sweep_time_of_impact_composite
Computes the time of impact between a stationary composite shape and a moving convex shape.