CollisionContact.ImpactSpeed Property
Definition¶
Namespace: Brine2D.Collision
Closing speed along the contact normal at the moment of detection.
Important: this value is only meaningful when received via
OnCollisionHit, which uses Box2D's
dedicated hit-event approach speed. When received via
OnCollisionEnter, the value is
always 0 — Box2D's normalVelocity is unreliable on the first contact
frame. When received via
Brine2D.ECS.Components.PhysicsBodyComponent.OnCollisionStay, the value is
derived from the manifold's normalVelocity field, which can be noisy.
Use OnCollisionHit with
EnableHitEvents for impact-speed-based
logic (e.g. collision sound volume).
public float ImpactSpeed { get; init; }