pub struct PersistentManifoldGpu {
pub body_a: u32,
pub body_b: u32,
pub points: [Option<ManifoldPoint>; 4],
pub num_points: usize,
}Expand description
Persistent 4-point contact manifold with warm-start impulse data.
Retains up to 4 contact points between a pair of bodies across frames, selecting the deepest/most-separated subset for stability.
Fields§
§body_a: u32Index of body A.
body_b: u32Index of body B.
points: [Option<ManifoldPoint>; 4]Retained contact points (up to 4).
num_points: usizeNumber of active contact points.
Implementations§
Source§impl PersistentManifoldGpu
impl PersistentManifoldGpu
Sourcepub fn add_contact(&mut self, new_pt: ManifoldPoint)
pub fn add_contact(&mut self, new_pt: ManifoldPoint)
Add or replace a contact point.
If there are fewer than 4 points the new point is simply appended. Otherwise the shallowest existing point is replaced if it is shallower than the new one.
Sourcepub fn remove_stale(&mut self, threshold: f32)
pub fn remove_stale(&mut self, threshold: f32)
Remove stale contact points whose depth has become positive (separated).
Sourcepub fn reset_warm_start(&mut self)
pub fn reset_warm_start(&mut self)
Reset warm-start impulses to zero.
Sourcepub fn active_points(&self) -> impl Iterator<Item = &ManifoldPoint>
pub fn active_points(&self) -> impl Iterator<Item = &ManifoldPoint>
Return an iterator over active contact points.
Trait Implementations§
Source§impl Clone for PersistentManifoldGpu
impl Clone for PersistentManifoldGpu
Source§fn clone(&self) -> PersistentManifoldGpu
fn clone(&self) -> PersistentManifoldGpu
Returns a duplicate of the value. Read more
1.0.0 · 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 PersistentManifoldGpu
impl RefUnwindSafe for PersistentManifoldGpu
impl Send for PersistentManifoldGpu
impl Sync for PersistentManifoldGpu
impl Unpin for PersistentManifoldGpu
impl UnsafeUnpin for PersistentManifoldGpu
impl UnwindSafe for PersistentManifoldGpu
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