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.
Never constructed. Sent as a parameter in the contact listener functions: BeginContact, EndContact, PreSolve, and PostSolve (see World:SetContactListener
).
- Box2dContact:GetManifold ()
- Box2dContact:GetNext ()
- Box2dContact:GetWorldManifold ()
- Box2dContact:IsTouching ()
- Box2dContact:SetEnabled (flag)
- Box2dContact:IsEnabled ()
- Box2dContact:GetFixtureA ()
- Box2dContact:GetChildIndexA ()
- Box2dContact:GetFixtureB ()
- Box2dContact:GetChildIndexB ()
- Box2dContact:SetFriction (friction)
- Box2dContact:GetFriction ()
- Box2dContact:ResetFriction ()
- Box2dContact:SetRestitution (restitution)
- Box2dContact:GetRestitution ()
- Box2dContact:ResetRestitution ()
- Box2dContact:SetRestitutionThreshold (threshold)
- Box2dContact:GetRestitutionThreshold ()
- Box2dContact:ResetRestitutionThreshold ()
- Box2dContact:SetTangentSpeed (speed)
- Box2dContact:GetTangentSpeed ()
Get the next contact in the world's contact list.
RETURN
- (Box2dConctact)|(nil)
Get the local manifold.
RETURN
Get the world manifold.
RETURN
Is this contact touching?
RETURN
- (boolean)
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).
PARAMETERS
flag
(boolean)
Has this contact been disabled?
RETURN
- (boolean)
Get fixture A in this contact.
RETURN
Get the child primitive index for fixture A.
RETURN
- (number)
Get fixture B in this contact.
RETURN
Get the child primitive index for fixture B.
RETURN
- (number)
Override the default friction mixture. You can call this in b2ContactListener::PreSolve. This value persists until set or reset.
PARAMETERS
friction
(number)
Get the friction.
RETURN
- (number)
Reset the friction mixture to the default value.
Override the default restitution mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.
PARAMETERS
restitution
(number)
Get the restitution.
RETURN
- (number)
Reset the restitution to the default value.
Override the default restitution velocity threshold mixture. You can call this in b2ContactListener::PreSolve. The value persists until you set or reset.
PARAMETERS
threshold
(number)
Get the restitution threshold.
RETURN
- (number)
Reset the restitution threshold to the default value.
Set the desired tangent speed for a conveyor belt behavior. In meters per second.
PARAMETERS
speed
(number)
Get the desired tangent speed. In meters per second.
RETURN
- (number)