org.jbox2d.callbacks.ContactImpulse Java Examples

The following examples show how to use org.jbox2d.callbacks.ContactImpulse. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Breakable.java    From jbox2d with BSD 2-Clause "Simplified" License 6 votes vote down vote up
@Override
public void postSolve(Contact contact, ContactImpulse impulse) {
  if (m_broke) {
    // The body already broke.
    return;
  }

  // Should the body break?
  int count = contact.getManifold().pointCount;

  float maxImpulse = 0.0f;
  for (int i = 0; i < count; ++i) {
    maxImpulse = MathUtils.max(maxImpulse, impulse.normalImpulses[i]);
  }

  if (maxImpulse > 40.0f) {
    // Flag the body for breaking.
    m_break = true;
  }
}
 
Example #2
Source File: Box2DContactListener.java    From Form-N-Fun with MIT License 4 votes vote down vote up
@Override
public void postSolve(Contact arg0, ContactImpulse arg1) {
    // TODO Auto-generated method stub

}
 
Example #3
Source File: TestbedTest.java    From jbox2d with BSD 2-Clause "Simplified" License votes vote down vote up
public void postSolve(Contact contact, ContactImpulse impulse) {}