Struct rhusics_core::Contact

source ·
pub struct Contact<P>where
    P: EuclideanSpace,
{ pub strategy: CollisionStrategy, pub normal: <P as EuclideanSpace>::Diff, pub penetration_depth: <P as EuclideanSpace>::Scalar, pub contact_point: P, pub time_of_impact: <P as EuclideanSpace>::Scalar, }
Expand description

Contact manifold for a single collision contact point.

Type parameters

  • P: cgmath point type

Fields

strategy: CollisionStrategy

The collision strategy used for this contact.

normal: <P as EuclideanSpace>::Diff

The collision normal. Only applicable if the collision strategy is not CollisionOnly

penetration_depth: <P as EuclideanSpace>::Scalar

The penetration depth. Only applicable if the collision strategy is not CollisionOnly

contact_point: P

The contact point. Only applicable if the collision strategy is not CollisionOnly

time_of_impact: <P as EuclideanSpace>::Scalar

The time of impact, only applicable for continuous collision detection, value is in range 0.0..1.0

Implementations

Create a new contact manifold, with default collision normal and penetration depth

Create a new contact manifold, with the given collision normal and penetration depth

Create a new contact manifold, complete with contact point

Trait Implementations

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.