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§
- Proxy
Distance Output - Result of
proxy_distance. All geometric quantities are expressed in the local frame of the first proxy. - Simplex
Cache - 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).
- Sweep
Composite Fast Shape - Parameters describing the fast (moving) shape for a composite TOI query.
- Sweep
ToiOutput - The result of a
sweep_time_of_impactcomputation. - ToiProxy
- A point cloud with a radius, approximating a convex shape for sweep-based time-of-impact computations.
Enums§
- Sweep
ToiStatus - The outcome of a
sweep_time_of_impactcomputation.
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.