pub trait NarrowPhase<P, T, B, Y = ()>: Sendwhere
    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>>; }
Expand description

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

Implementors