pub struct ContactGenerationKernel;Expand description
Contact generation kernel: generates contact points between sphere-shaped bodies.
Implementations§
Source§impl ContactGenerationKernel
impl ContactGenerationKernel
Sourcepub fn generate_sphere_contacts(
positions: &[[f64; 3]],
radii: &[f64],
pairs: &[(usize, usize)],
) -> Vec<ContactPoint>
pub fn generate_sphere_contacts( positions: &[[f64; 3]], radii: &[f64], pairs: &[(usize, usize)], ) -> Vec<ContactPoint>
Generate contacts between sphere bodies.
positions[i] is the position of body i.
radii[i] is the radius of body i.
pairs is the list of potentially overlapping pairs from broadphase.
Sourcepub fn resolve_contacts(
positions: &mut [[f64; 3]],
velocities: &mut [[f64; 3]],
inv_masses: &[f64],
contacts: &[ContactPoint],
restitution: f64,
)
pub fn resolve_contacts( positions: &mut [[f64; 3]], velocities: &mut [[f64; 3]], inv_masses: &[f64], contacts: &[ContactPoint], restitution: f64, )
Apply contact impulses to resolve penetration.
Uses a simple position-correction approach.
Auto Trait Implementations§
impl Freeze for ContactGenerationKernel
impl RefUnwindSafe for ContactGenerationKernel
impl Send for ContactGenerationKernel
impl Sync for ContactGenerationKernel
impl Unpin for ContactGenerationKernel
impl UnsafeUnpin for ContactGenerationKernel
impl UnwindSafe for ContactGenerationKernel
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more