pub struct GpuContactManifold {
pub body_a: usize,
pub body_b: usize,
pub contact_points: Vec<[f32; 3]>,
pub normals: Vec<[f32; 3]>,
pub depths: Vec<f32>,
}Expand description
Contact manifold between two rigid bodies.
Stores the list of contact points, surface normals, and penetration depths generated during narrowphase collision resolution.
Fields§
§body_a: usizeIndex of the first body.
body_b: usizeIndex of the second body.
contact_points: Vec<[f32; 3]>World-space contact points.
normals: Vec<[f32; 3]>Outward contact normals (from A towards B).
depths: Vec<f32>Penetration depths (positive = overlapping).
Implementations§
Source§impl GpuContactManifold
impl GpuContactManifold
Sourcepub fn new(body_a: usize, body_b: usize) -> Self
pub fn new(body_a: usize, body_b: usize) -> Self
Create an empty manifold for the given body pair.
Sourcepub fn add_contact(&mut self, point: [f32; 3], normal: [f32; 3], depth: f32)
pub fn add_contact(&mut self, point: [f32; 3], normal: [f32; 3], depth: f32)
Add a single contact to the manifold.
point– world-space contact point.normal– surface normal pointing from A to B.depth– penetration depth (positive value).
Sourcepub fn contact_count(&self) -> usize
pub fn contact_count(&self) -> usize
Number of contact points in this manifold.
Sourcepub fn max_penetration(&self) -> f32
pub fn max_penetration(&self) -> f32
Maximum penetration depth across all contacts, or 0.0 if empty.
Trait Implementations§
Source§impl Clone for GpuContactManifold
impl Clone for GpuContactManifold
Source§fn clone(&self) -> GpuContactManifold
fn clone(&self) -> GpuContactManifold
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 GpuContactManifold
impl RefUnwindSafe for GpuContactManifold
impl Send for GpuContactManifold
impl Sync for GpuContactManifold
impl Unpin for GpuContactManifold
impl UnsafeUnpin for GpuContactManifold
impl UnwindSafe for GpuContactManifold
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