pub struct ContactManifoldGpu {
pub body_a: usize,
pub body_b: usize,
pub contact_points: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub penetrations: Vec<f32>,
}Expand description
Contact manifold between two bodies produced by the narrowphase.
Fields§
§body_a: usizeIndex of the first body.
body_b: usizeIndex of the second body.
contact_points: Vec<[f32; 3]>Contact point positions in world space.
normals: Vec<[f32; 3]>Outward contact normals (pointing from B to A), one per contact point.
penetrations: Vec<f32>Penetration depths (positive means overlapping), one per contact point.
Implementations§
Source§impl ContactManifoldGpu
impl ContactManifoldGpu
Sourcepub fn new(body_a: usize, body_b: usize) -> Self
pub fn new(body_a: usize, body_b: usize) -> Self
Create a new, empty contact manifold between two bodies.
Sourcepub fn add_contact(
&mut self,
point: [f32; 3],
normal: [f32; 3],
penetration: f32,
)
pub fn add_contact( &mut self, point: [f32; 3], normal: [f32; 3], penetration: f32, )
Add a single contact point to the manifold.
Sourcepub fn contact_count(&self) -> usize
pub fn contact_count(&self) -> usize
Number of contact points in the manifold.
Trait Implementations§
Source§impl Clone for ContactManifoldGpu
impl Clone for ContactManifoldGpu
Source§fn clone(&self) -> ContactManifoldGpu
fn clone(&self) -> ContactManifoldGpu
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ContactManifoldGpu
impl RefUnwindSafe for ContactManifoldGpu
impl Send for ContactManifoldGpu
impl Sync for ContactManifoldGpu
impl Unpin for ContactManifoldGpu
impl UnsafeUnpin for ContactManifoldGpu
impl UnwindSafe for ContactManifoldGpu
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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