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 typeT
: model-to-world transform typeB
: Bounding volumeY
: Shape type (seeCollider
)
Required Methods
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>>
&self,
left: &CollisionShape<P, T, B, Y>,
left_transform: &T,
right: &CollisionShape<P, T, B, Y>,
right_transform: &T
) -> Option<Contact<P::Point>>
Check if two shapes collides, and give a contact manifold for the contact with the largest penetration depth.
Parameters:
left
: the left shapeleft_transform
: model-to-world transform for the left shaperight
: the right shaperight_transform
: model-to-world transform for the right shape
Returns:
Optionally returns the contact manifold for the contact with largest penetration depth
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>>
&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>>
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 shapeleft_start_transform
: model-to-world transform for the left shape, at start of frameleft_end_transform
: model-to-world transform for the left shape, at end of frameright
: the right shaperight_start_transform
: model-to-world transform for the right shape, at start of frameright_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]
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,
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>>
[src]
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>>
[src]
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>>