#[non_exhaustive]pub struct CollisionEstimate {
pub linear_velocity1: Vec3,
pub angular_velocity1: Vec3,
pub linear_velocity2: Vec3,
pub angular_velocity2: Vec3,
pub contact_impulses: Vec<f32>,
pub tangent1: Vec3,
pub tangent2: Vec3,
pub friction_impulse1: f32,
pub friction_impulse2: f32,
pub angular_friction_impulse: f32,
}Expand description
What Jolt estimates a new contact does to its two bodies, before the solver runs (Jolt
EstimateCollisionResponse), from ContactEvent::Added when
EventSettings::collision_estimates is on.
Jolt solves the contact of the two bodies alone, with the contact’s friction and restitution
and the world’s restitution threshold and velocity iterations, so the result is exact only
for an isolated pair: other contacts and constraints on either body in the same step are not
part of it. It does not model the contact’s mass and inertia scales, surface velocities,
locked axes or the speed limits. It bounces the velocity that the step’s gravity and forces
have already changed, while the solver takes that change out of the bounce, so under gravity
the estimated rebound is faster by restitution · g · dt along the normal. A speculative
contact (negative penetration depth) is estimated as if the bodies touched. A contact found
in the continuous collision stage is estimated from the velocities after the step’s solve,
at the time-of-impact points, which makes its angular part approximate.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.linear_velocity1: Vec3Linear velocity of body 1 after the impact, m/s.
angular_velocity1: Vec3Angular velocity of body 1 after the impact, rad/s.
linear_velocity2: Vec3Linear velocity of body 2 after the impact, m/s.
angular_velocity2: Vec3Angular velocity of body 2 after the impact, rad/s.
contact_impulses: Vec<f32>Impulse along the contact normal at each point of the manifold, in the order of
ContactManifold::points, N·s. Their sum is the
impact’s total normal impulse.
tangent1: Vec3First friction direction, a unit vector perpendicular to the normal.
tangent2: Vec3Second friction direction, normal × tangent1.
friction_impulse1: f32Friction impulse along tangent1, N·s.
friction_impulse2: f32Friction impulse along tangent2, N·s.
angular_friction_impulse: f32Friction impulse about the normal, N·m·s.