Function rhusics_core::resolve_contact
source · pub fn resolve_contact<'a, B, P, R, I, A, O>(
contact: &Contact<P>,
a: &ResolveData<'a, B, P, R, I, A>,
b: &ResolveData<'a, B, P, R, I, A>
) -> (SingleChangeSet<B, P, R, A>, SingleChangeSet<B, P, R, A>)where
P: EuclideanSpace + 'a,
P::Scalar: BaseFloat,
R: Rotation<P> + 'a,
P::Diff: Debug + Zero + Clone + InnerSpace + PartialCrossProduct<P::Diff, Output = O>,
O: PartialCrossProduct<P::Diff, Output = P::Diff>,
A: PartialCrossProduct<P::Diff, Output = P::Diff> + Clone + Zero + 'a,
&'a A: Sub<O, Output = A> + Add<O, Output = A>,
I: Inertia<Orientation = R> + Mul<O, Output = O>,
B: Pose<P, R> + 'a,
Expand description
Perform contact resolution.
Will compute any new poses and/or velocities, by doing impulse resolution of the given contact.
Parameters:
contact
: The contact; contact normal must point from shape A -> Ba
: Resolution data for shape Ab
: Resolution data for shape B
Returns
Tuple of change sets, first change set is for shape A, second change set for shape B.
Type parameters:
B
: Transform type (BodyPose3
or similar)P
: Point type, usuallyPoint2
orPoint3
R
: Rotational quantity, usuallyBasis2
orQuaternion
A
: Angular velocity, usuallyScalar
orVector3
I
: Inertia, usuallyScalar
orMatrix3
O
: Internal type used for unifying cross products for 2D/3D, usuallyScalar
orVector3