public abstract class Contact
- Object
- Contact
Known subtypesChainAndCircleContact, ChainAndPolygonContact, CircleContact, EdgeAndCircleContact, EdgeAndPolygonContact, PolygonAndCircleContact, PolygonContact
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.
Fields
Constructors
protected Contact(IWorldPool argPool) |
Methods
Inherited methods
Field details
ISLAND_FLAG
public static final int ISLAND_FLAG = 1TOUCHING_FLAG
public static final int TOUCHING_FLAG = 2ENABLED_FLAG
public static final int ENABLED_FLAG = 4FILTER_FLAG
public static final int FILTER_FLAG = 8BULLET_HIT_FLAG
public static final int BULLET_HIT_FLAG = 16TOI_FLAG
public static final int TOI_FLAG = 32m_flags
public int m_flagsm_prev
public Contact m_prevm_next
public Contact m_nextm_nodeA
public ContactEdge m_nodeAm_nodeB
public ContactEdge m_nodeBm_fixtureA
public Fixture m_fixtureAm_fixtureB
public Fixture m_fixtureBm_indexA
public int m_indexAm_indexB
public int m_indexBm_manifold
public final Manifold m_manifoldm_toiCount
public float m_toiCountm_toi
public float m_toim_friction
public float m_frictionm_restitution
public float m_restitutionm_tangentSpeed
public float m_tangentSpeedpool
protected final IWorldPool poolConstructor details
Contact
protected Contact(IWorldPool argPool)Method details
init
public void init(Fixture fA, int indexA, Fixture fB, int indexB)initialization for pooling
getManifold
public Manifold getManifold()Get the contact manifold. Do not set the point count to zero. Instead call Disable.
getWorldManifold
public void getWorldManifold(WorldManifold worldManifold)Get the world manifold.
isTouching
public boolean isTouching()Is this contact touching
setEnabled
public void setEnabled(boolean flag)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).
isEnabled
public boolean isEnabled()Has this contact been disabled?
getNext
public Contact getNext()Get the next contact in the world’s contact list.
getFixtureA
public Fixture getFixtureA()Get the first fixture in this contact.
getChildIndexA
public int getChildIndexA()getFixtureB
public Fixture getFixtureB()Get the second fixture in this contact.
getChildIndexB
public int getChildIndexB()setFriction
public void setFriction(float friction)getFriction
public float getFriction()resetFriction
public void resetFriction()setRestitution
public void setRestitution(float restitution)getRestitution
public float getRestitution()resetRestitution
public void resetRestitution()setTangentSpeed
public void setTangentSpeed(float speed)getTangentSpeed
public float getTangentSpeed()evaluate
public abstract void evaluate(Manifold manifold, Transform xfA, Transform xfB)flagForFiltering
public void flagForFiltering()Flag this contact for filtering. Filtering will occur the next time step.
update
public void update(ContactListener listener)mixFriction
public static final float mixFriction(float friction1, float friction2)Friction mixing law. The idea is to allow either fixture to drive the restitution to zero. For
example, anything slides on ice.
mixRestitution
public static final float mixRestitution(float restitution1, float restitution2)Restitution mixing law. The idea is allow for anything to bounce off an inelastic surface. For
example, a superball bounces on anything.