[][src]Struct collision::Contact

pub struct Contact<P: EuclideanSpace> {
    pub strategy: CollisionStrategy,
    pub normal: P::Diff,
    pub penetration_depth: P::Scalar,
    pub contact_point: P,
    pub time_of_impact: P::Scalar,
}

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::Diff

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

penetration_depth: P::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::Scalar

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

Methods

impl<P> Contact<P> where
    P: EuclideanSpace,
    P::Diff: VectorSpace + Zero
[src]

pub fn new(strategy: CollisionStrategy) -> Self[src]

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

pub fn new_impl(
    strategy: CollisionStrategy,
    normal: P::Diff,
    penetration_depth: P::Scalar
) -> Self
[src]

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

pub fn new_with_point(
    strategy: CollisionStrategy,
    normal: P::Diff,
    penetration_depth: P::Scalar,
    contact_point: P
) -> Self
[src]

Create a new contact manifold, complete with contact point

Trait Implementations

impl<P: Clone + EuclideanSpace> Clone for Contact<P> where
    P::Diff: Clone,
    P::Scalar: Clone,
    P::Scalar: Clone
[src]

default fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<P: Debug + EuclideanSpace> Debug for Contact<P> where
    P::Diff: Debug,
    P::Scalar: Debug,
    P::Scalar: Debug
[src]

Auto Trait Implementations

impl<P> Send for Contact<P> where
    P: Send,
    <P as EuclideanSpace>::Diff: Send,
    <P as EuclideanSpace>::Scalar: Send

impl<P> Sync for Contact<P> where
    P: Sync,
    <P as EuclideanSpace>::Diff: Sync,
    <P as EuclideanSpace>::Scalar: Sync

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]