Trait rhusics_core::NarrowPhase[][src]

pub trait NarrowPhase<P, T, B, Y = ()>: Send where
    P: Primitive,
    <P::Point as EuclideanSpace>::Diff: Debug
{ fn collide(
        &self,
        left: &CollisionShape<P, T, B, Y>,
        left_transform: &T,
        right: &CollisionShape<P, T, B, Y>,
        right_transform: &T
    ) -> Option<Contact<P::Point>>;
fn collide_continuous(
        &self,
        left: &CollisionShape<P, T, B, Y>,
        left_start_transform: &T,
        left_end_transform: Option<&T>,
        right: &CollisionShape<P, T, B, Y>,
        right_start_transform: &T,
        right_end_transform: Option<&T>
    ) -> Option<Contact<P::Point>>; }

Base trait implemented by all narrow phase algorithms.

Type parameters:

  • P: collision primitive type
  • T: model-to-world transform type
  • B: Bounding volume
  • Y: Shape type (see Collider)

Required Methods

Check if two shapes collides, and give a contact manifold for the contact with the largest penetration depth.

Parameters:

  • left: the left shape
  • left_transform: model-to-world transform for the left shape
  • right: the right shape
  • right_transform: model-to-world transform for the right shape

Returns:

Optionally returns the contact manifold for the contact with largest penetration depth

Check if two shapes collides along the given transformation paths, and give a contact manifold for the contact with the earliest time of impact.

Will only use continuous detection if one of the shapes have Continuous collision mode.

Parameters:

  • left: the left shape
  • left_start_transform: model-to-world transform for the left shape, at start of frame
  • left_end_transform: model-to-world transform for the left shape, at end of frame
  • right: the right shape
  • right_start_transform: model-to-world transform for the right shape, at start of frame
  • right_end_transform: model-to-world transform for the right shape, at end of frame

Returns:

Optionally returns the contact manifold for the contact with largest penetration depth

Implementations on Foreign Types

impl<P, T, Y, S, E, B> NarrowPhase<P, T, B, Y> for GJK<S, E, <P::Point as EuclideanSpace>::Scalar> where
    P: Primitive,
    P::Point: EuclideanSpace,
    <P::Point as EuclideanSpace>::Scalar: BaseFloat + Send + Sync + 'static,
    <P::Point as EuclideanSpace>::Diff: Debug + InnerSpace + Array<Element = <P::Point as EuclideanSpace>::Scalar> + Neg<Output = <P::Point as EuclideanSpace>::Diff>,
    S: SimplexProcessor<Point = P::Point> + Send,
    E: EPA<Point = P::Point> + Send,
    T: Transform<P::Point> + Interpolate<<P::Point as EuclideanSpace>::Scalar> + TranslationInterpolate<<P::Point as EuclideanSpace>::Scalar>,
    Y: Collider
[src]

Implementors