Class b2Contact

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.

Index

Constructor methods

Methods

Constructor methods

constructor(): b2Contact

Constructor

Returns

b2Contact

Methods

public FlagForFiltering()

Flag this contact for filtering. Filtering will occur the next time step.

public GetFixtureA(): b2Fixture

Get the first fixture in this contact.

Returns

b2Fixture

First fixture in this contact.

public GetFixtureB(): b2Fixture

Get the second fixture in this contact.

Returns

b2Fixture

Second fixture in this contact.

public GetManifold(): b2Manifold

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

Returns

b2Manifold

Contact manifold.

public GetNext(): b2Contact

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

Returns

b2Contact

Next contact in the world's contact list.

public GetWorldManifold(worldManifold: b2WorldManifold)

Get the world manifold.

Parameters

public IsContinuous(): boolean

Does this contact generate TOI events for continuous simulation.

Returns

boolean

True for continous, otherwise false.

public IsEnabled(): boolean

Has this contact been disabled?

Returns

boolean

True if disabled, otherwise false.

public IsSensor(): boolean

Is this contact a sensor?

Returns

boolean

True if sensor, otherwise false.

public IsTouching(): boolean

Is this contact touching.

Returns

boolean

True if contact is touching, otherwise false.

public SetEnabled(flag: 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 collision).

Parameters

  • flag: boolean

    True to enable, false to disable.

public SetSensor(sensor: boolean)

Change this to be a sensor or-non-sensor contact.

Parameters

  • sensor: boolean

    True to be sensor, false to not be a sensor.