#[repr(C)]pub struct b2ManifoldPoint {
pub point: b2Vec2,
pub anchorA: b2Vec2,
pub anchorB: b2Vec2,
pub separation: f32,
pub normalImpulse: f32,
pub tangentImpulse: f32,
pub totalNormalImpulse: f32,
pub normalVelocity: f32,
pub id: u16,
pub persisted: bool,
}Expand description
A manifold point is a contact point belonging to a contact manifold. It holds details related to the geometry and dynamics of the contact points. Box2D uses speculative collision so some contact points may be separated. You may use the totalNormalImpulse to determine if there was an interaction during the time step.
Fields§
§point: b2Vec2Location of the contact point in world space. Subject to precision loss at large coordinates. @note Should only be used for debugging.
anchorA: b2Vec2Location of the contact point relative to shapeA’s origin in world space @note When used internally to the Box2D solver, this is relative to the body center of mass.
anchorB: b2Vec2Location of the contact point relative to shapeB’s origin in world space @note When used internally to the Box2D solver, this is relative to the body center of mass.
separation: f32The separation of the contact point, negative if penetrating
normalImpulse: f32The impulse along the manifold normal vector.
tangentImpulse: f32The friction impulse
totalNormalImpulse: f32The total normal impulse applied across sub-stepping and restitution. This is important to identify speculative contact points that had an interaction in the time step. This includes the warm starting impulse, the sub-step delta impulse, and the restitution impulse.
normalVelocity: f32Relative normal velocity pre-solve. Used for hit events. If the normal impulse is zero then there was no hit. Negative means shapes are approaching.
id: u16Uniquely identifies a contact point between two shapes
persisted: boolDid this contact point exist the previous step?
Trait Implementations§
Source§impl Clone for b2ManifoldPoint
impl Clone for b2ManifoldPoint
Source§fn clone(&self) -> b2ManifoldPoint
fn clone(&self) -> b2ManifoldPoint
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for b2ManifoldPoint
impl Debug for b2ManifoldPoint
impl Copy for b2ManifoldPoint
Auto Trait Implementations§
impl Freeze for b2ManifoldPoint
impl RefUnwindSafe for b2ManifoldPoint
impl Send for b2ManifoldPoint
impl Sync for b2ManifoldPoint
impl Unpin for b2ManifoldPoint
impl UnwindSafe for b2ManifoldPoint
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)