b2ManifoldPoint

Struct b2ManifoldPoint 

Source
#[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: b2Vec2

Location of the contact point in world space. Subject to precision loss at large coordinates. @note Should only be used for debugging.

§anchorA: b2Vec2

Location 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: b2Vec2

Location 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: f32

The separation of the contact point, negative if penetrating

§normalImpulse: f32

The impulse along the manifold normal vector.

§tangentImpulse: f32

The friction impulse

§totalNormalImpulse: f32

The 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: f32

Relative 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: u16

Uniquely identifies a contact point between two shapes

§persisted: bool

Did this contact point exist the previous step?

Trait Implementations§

Source§

impl Clone for b2ManifoldPoint

Source§

fn clone(&self) -> b2ManifoldPoint

Returns a duplicate of the value. Read more
1.0.0§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for b2ManifoldPoint

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Copy for b2ManifoldPoint

Auto Trait Implementations§

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> CloneToUninit for T
where T: Clone,

§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.