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
impl b2Contact
Sourcepub fn SetEnabled(self: Pin<&mut b2Contact>, flag: bool)
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).
Sourcepub fn GetNext(self: Pin<&mut b2Contact>) -> *mut b2Contact
pub fn GetNext(self: Pin<&mut b2Contact>) -> *mut b2Contact
Get the next contact in the world’s contact list.
pub fn GetNext1(self: &b2Contact) -> *const b2Contact
Sourcepub fn SetFriction(self: Pin<&mut b2Contact>, friction: f32)
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.
Sourcepub fn GetFriction(self: &b2Contact) -> f32
pub fn GetFriction(self: &b2Contact) -> f32
Get the friction.
Sourcepub fn SetRestitution(self: Pin<&mut b2Contact>, restitution: f32)
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.
Sourcepub fn GetRestitution(self: &b2Contact) -> f32
pub fn GetRestitution(self: &b2Contact) -> f32
Get the restitution.
Sourcepub fn SetRestitutionThreshold(self: Pin<&mut b2Contact>, threshold: f32)
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.
Sourcepub fn GetRestitutionThreshold(self: &b2Contact) -> f32
pub fn GetRestitutionThreshold(self: &b2Contact) -> f32
Get the restitution threshold.
Sourcepub unsafe fn Evaluate(
self: Pin<&mut b2Contact>,
manifold: *mut b2Manifold,
xfA: &b2Transform,
xfB: &b2Transform,
)
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
impl b2Contact
Sourcepub fn GetManifold(self: Pin<&mut Self>) -> *mut b2Manifold
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.
pub fn GetManifold1(&self) -> *const b2Manifold
Sourcepub unsafe fn GetWorldManifold(&self, worldManifold: *mut b2WorldManifold)
pub unsafe fn GetWorldManifold(&self, worldManifold: *mut b2WorldManifold)
Get the world manifold.
Sourcepub fn IsTouching(&self) -> bool
pub fn IsTouching(&self) -> bool
Is this contact touching?
Sourcepub fn GetFixtureA(self: Pin<&mut Self>) -> *mut b2Fixture
pub fn GetFixtureA(self: Pin<&mut Self>) -> *mut b2Fixture
Get fixture A in this contact.
pub fn GetFixtureA1(&self) -> *const b2Fixture
Sourcepub fn GetChildIndexA(&self) -> c_int
pub fn GetChildIndexA(&self) -> c_int
Get the child primitive index for fixture A.
Sourcepub fn GetFixtureB(self: Pin<&mut Self>) -> *mut b2Fixture
pub fn GetFixtureB(self: Pin<&mut Self>) -> *mut b2Fixture
Get fixture B in this contact.
pub fn GetFixtureB1(&self) -> *const b2Fixture
Sourcepub fn GetChildIndexB(&self) -> c_int
pub fn GetChildIndexB(&self) -> c_int
Get the child primitive index for fixture B.
Sourcepub fn ResetFriction(self: Pin<&mut Self>)
pub fn ResetFriction(self: Pin<&mut Self>)
Reset the friction mixture to the default value.
Sourcepub fn ResetRestitution(self: Pin<&mut Self>)
pub fn ResetRestitution(self: Pin<&mut Self>)
Reset the restitution to the default value.
Sourcepub fn ResetRestitutionThreshold(self: Pin<&mut Self>)
pub fn ResetRestitutionThreshold(self: Pin<&mut Self>)
Reset the restitution threshold to the default value.
Sourcepub fn SetTangentSpeed(self: Pin<&mut Self>, speed: f32)
pub fn SetTangentSpeed(self: Pin<&mut Self>, speed: f32)
Set the desired tangent speed for a conveyor belt behavior. In meters per second.
Sourcepub fn GetTangentSpeed(&self) -> f32
pub fn GetTangentSpeed(&self) -> f32
Get the desired tangent speed. In meters per second.