Skip to main content

b2Contact

Struct b2Contact 

Source
pub struct b2Contact { /* private fields */ }
Expand description

The class manages contact between two shapes. A contact exists for each overlapping AABB in the broad-phase (except if filtered). Therefore a contact object may exist that has no contact points.

Implementations§

Source§

impl b2Contact

Source

pub fn SetEnabled(self: Pin<&mut b2Contact>, flag: bool)

Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is only disabled for the current time step (or sub-step in continuous collisions).

Source

pub fn IsEnabled(self: &b2Contact) -> bool

Has this contact been disabled?

Source

pub fn GetNext(self: Pin<&mut b2Contact>) -> *mut b2Contact

Get the next contact in the world’s contact list.

Source

pub fn GetNext1(self: &b2Contact) -> *const b2Contact

Source

pub fn SetFriction(self: Pin<&mut b2Contact>, friction: f32)

Override the default friction mixture. You can call this in b2ContactListener::PreSolve. This value persists until set or reset.

Source

pub fn GetFriction(self: &b2Contact) -> f32

Get the friction.

Source

pub fn SetRestitution(self: Pin<&mut b2Contact>, restitution: f32)

Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.

Source

pub fn GetRestitution(self: &b2Contact) -> f32

Get the restitution.

Source

pub fn SetRestitutionThreshold(self: Pin<&mut b2Contact>, threshold: f32)

Override the default restitution velocity threshold mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.

Source

pub fn GetRestitutionThreshold(self: &b2Contact) -> f32

Get the restitution threshold.

Source

pub unsafe fn Evaluate( self: Pin<&mut b2Contact>, manifold: *mut b2Manifold, xfA: &b2Transform, xfB: &b2Transform, )

Evaluate this contact with your own manifold and transforms.

Source§

impl b2Contact

Source

pub fn GetManifold(self: Pin<&mut Self>) -> *mut b2Manifold

Get the contact manifold. Do not modify the manifold unless you understand the internals of Box2D.

Source

pub fn GetManifold1(&self) -> *const b2Manifold

Source

pub unsafe fn GetWorldManifold(&self, worldManifold: *mut b2WorldManifold)

Get the world manifold.

Source

pub fn IsTouching(&self) -> bool

Is this contact touching?

Source

pub fn GetFixtureA(self: Pin<&mut Self>) -> *mut b2Fixture

Get fixture A in this contact.

Source

pub fn GetFixtureA1(&self) -> *const b2Fixture

Source

pub fn GetChildIndexA(&self) -> c_int

Get the child primitive index for fixture A.

Source

pub fn GetFixtureB(self: Pin<&mut Self>) -> *mut b2Fixture

Get fixture B in this contact.

Source

pub fn GetFixtureB1(&self) -> *const b2Fixture

Source

pub fn GetChildIndexB(&self) -> c_int

Get the child primitive index for fixture B.

Source

pub fn ResetFriction(self: Pin<&mut Self>)

Reset the friction mixture to the default value.

Source

pub fn ResetRestitution(self: Pin<&mut Self>)

Reset the restitution to the default value.

Source

pub fn ResetRestitutionThreshold(self: Pin<&mut Self>)

Reset the restitution threshold to the default value.

Source

pub fn SetTangentSpeed(self: Pin<&mut Self>, speed: f32)

Set the desired tangent speed for a conveyor belt behavior. In meters per second.

Source

pub fn GetTangentSpeed(&self) -> f32

Get the desired tangent speed. In meters per second.

Trait Implementations§

Source§

impl ExternType for b2Contact

Source§

type Kind = Opaque

Source§

type Id

A type-level representation of the type’s C++ namespace and type name. Read more
Source§

impl MakeCppStorage for b2Contact

Source§

unsafe fn allocate_uninitialized_cpp_storage() -> *mut b2Contact

Allocates heap space for this type in C++ and return a pointer to that space, but do not initialize that space (i.e. do not yet call a constructor). Read more
Source§

unsafe fn free_uninitialized_cpp_storage(arg0: *mut b2Contact)

Frees a C++ allocation which has not yet had a constructor called. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

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

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

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

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

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

Source§

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

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

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

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

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

Source§

type Error = Infallible

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

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

Performs the conversion.
Source§

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

Source§

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

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

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

Performs the conversion.