pub type Contact = TrackedContact<ContactData>;Expand description
A contact between two colliders.
Aliased Type§
pub struct Contact {
pub local_p1: OPoint<f32, Const<3>>,
pub local_p2: OPoint<f32, Const<3>>,
pub dist: f32,
pub fid1: PackedFeatureId,
pub fid2: PackedFeatureId,
pub data: ContactData,
}Fields§
§local_p1: OPoint<f32, Const<3>>The contact point in the local-space of the first shape.
This is the point on the first shape’s surface (or interior if penetrating) that is closest to or in contact with the second shape.
local_p2: OPoint<f32, Const<3>>The contact point in the local-space of the second shape.
This is the point on the second shape’s surface (or interior if penetrating) that is closest to or in contact with the first shape.
dist: f32The signed distance between the two contact points.
- Negative values indicate penetration (shapes are overlapping)
- Positive values indicate separation (used with contact prediction)
- Zero means the shapes are exactly touching
The magnitude represents the distance along the contact normal.
fid1: PackedFeatureIdThe feature ID of the first shape involved in the contact.
This identifies which geometric feature (vertex, edge, or face) of the first shape is involved in this contact. Used for contact tracking across frames.
fid2: PackedFeatureIdThe feature ID of the second shape involved in the contact.
This identifies which geometric feature (vertex, edge, or face) of the second shape is involved in this contact. Used for contact tracking across frames.
data: ContactDataUser-data associated to this contact.
This can be used to store any additional information you need to track per-contact, such as:
- Accumulated impulses for warm-starting in physics solvers
- Contact age or lifetime
- Material properties or friction state
- Custom identifiers or flags