org.jbox2d.dynamics.contacts
Class Contact

java.lang.Object
  extended by org.jbox2d.dynamics.contacts.Contact
Direct Known Subclasses:
CircleContact, PolygonAndCircleContact, PolygonContact

public abstract class Contact
extends Object

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.

Author:
daniel

Field Summary
static int BULLET_HIT_FLAG
           
static int ENABLED_FLAG
           
static int FILTER_FLAG
           
static int ISLAND_FLAG
           
 Fixture m_fixtureA
           
 Fixture m_fixtureB
           
 int m_flags
           
 Manifold m_manifold
           
 Contact m_next
           
 ContactEdge m_nodeA
           
 ContactEdge m_nodeB
           
 Contact m_prev
           
 float m_toiCount
           
protected  IWorldPool pool
           
static int TOUCHING_FLAG
           
 
Constructor Summary
protected Contact(IWorldPool argPool)
           
 
Method Summary
abstract  void evaluate(Manifold manifold, Transform xfA, Transform xfB)
           
 void flagForFiltering()
          Flag this contact for filtering.
 Fixture getFixtureA()
          Get the first fixture in this contact.
 Fixture getFixtureB()
          Get the second fixture in this contact.
 Manifold getManifold()
          Get the contact manifold.
 Contact getNext()
          Get the next contact in the world's contact list.
 void getWorldManifold(WorldManifold worldManifold)
          Get the world manifold.
 void init(Fixture fA, Fixture fB)
          initialization for pooling
 boolean isEnabled()
          Has this contact been disabled?
 boolean isTouching()
          Is this contact touching
 void setEnabled(boolean flag)
          Enable/disable this contact.
 void update(ContactListener listener)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ISLAND_FLAG

public static final int ISLAND_FLAG
See Also:
Constant Field Values

TOUCHING_FLAG

public static final int TOUCHING_FLAG
See Also:
Constant Field Values

ENABLED_FLAG

public static final int ENABLED_FLAG
See Also:
Constant Field Values

FILTER_FLAG

public static final int FILTER_FLAG
See Also:
Constant Field Values

BULLET_HIT_FLAG

public static final int BULLET_HIT_FLAG
See Also:
Constant Field Values

m_flags

public int m_flags

m_prev

public Contact m_prev

m_next

public Contact m_next

m_nodeA

public ContactEdge m_nodeA

m_nodeB

public ContactEdge m_nodeB

m_fixtureA

public Fixture m_fixtureA

m_fixtureB

public Fixture m_fixtureB

m_manifold

public Manifold m_manifold

m_toiCount

public float m_toiCount

pool

protected final IWorldPool pool
Constructor Detail

Contact

protected Contact(IWorldPool argPool)
Method Detail

init

public void init(Fixture fA,
                 Fixture fB)
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

Returns:

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).

Parameters:
flag -

isEnabled

public boolean isEnabled()
Has this contact been disabled?

Returns:

getNext

public Contact getNext()
Get the next contact in the world's contact list.

Returns:

getFixtureA

public Fixture getFixtureA()
Get the first fixture in this contact.

Returns:

getFixtureB

public Fixture getFixtureB()
Get the second fixture in this contact.

Returns:

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)


Copyright © 2012. All Rights Reserved.