Tabnine Logo
ContactListener
Code IndexAdd Tabnine to your IDE (free)

How to use
ContactListener
in
org.jbox2d.callbacks

Best Java code snippets using org.jbox2d.callbacks.ContactListener (Showing top 15 results out of 315)

origin: libgdx/libgdx

listener.beginContact(this);
listener.endContact(this);
listener.preSolve(this, oldManifold);
origin: libgdx/libgdx

 public void report(ContactVelocityConstraint[] constraints) {
  if (m_listener == null) {
   return;
  }

  for (int i = 0; i < m_contactCount; ++i) {
   Contact c = m_contacts[i];

   ContactVelocityConstraint vc = constraints[i];
   impulse.count = vc.pointCount;
   for (int j = 0; j < vc.pointCount; ++j) {
    impulse.normalImpulses[j] = vc.points[j].normalImpulse;
    impulse.tangentImpulses[j] = vc.points[j].tangentImpulse;
   }

   m_listener.postSolve(c, impulse);
  }
 }
}
origin: libgdx/libgdx

m_contactListener.endContact(c);
origin: jbox2d/jbox2d

m_contactListener.endContact(c);
origin: jbox2d/jbox2d

listener.beginContact(this);
listener.endContact(this);
listener.preSolve(this, oldManifold);
origin: jbox2d/jbox2d

 public void report(ContactVelocityConstraint[] constraints) {
  if (m_listener == null) {
   return;
  }

  for (int i = 0; i < m_contactCount; ++i) {
   Contact c = m_contacts[i];

   ContactVelocityConstraint vc = constraints[i];
   impulse.count = vc.pointCount;
   for (int j = 0; j < vc.pointCount; ++j) {
    impulse.normalImpulses[j] = vc.points[j].normalImpulse;
    impulse.tangentImpulses[j] = vc.points[j].tangentImpulse;
   }

   m_listener.postSolve(c, impulse);
  }
 }
}
origin: com.github.almasb/fxgl-physics

m_contactListener.endContact(c);
origin: com.github.almasb/fxgl-physics

listener.beginContact(this);
listener.endContact(this);
listener.preSolve(this, oldManifold);
origin: andmizi/MobikeTags

 public void report(ContactVelocityConstraint[] constraints) {
  if (m_listener == null) {
   return;
  }

  for (int i = 0; i < m_contactCount; ++i) {
   Contact c = m_contacts[i];

   ContactVelocityConstraint vc = constraints[i];
   impulse.count = vc.pointCount;
   for (int j = 0; j < vc.pointCount; ++j) {
    impulse.normalImpulses[j] = vc.points[j].normalImpulse;
    impulse.tangentImpulses[j] = vc.points[j].tangentImpulse;
   }

   m_listener.postSolve(c, impulse);
  }
 }
}
origin: org.jbox2d/jbox2d-library

m_contactListener.endContact(c);
origin: andmizi/MobikeTags

listener.beginContact(this);
listener.endContact(this);
listener.preSolve(this, oldManifold);
origin: org.jbox2d/jbox2d-library

 public void report(ContactVelocityConstraint[] constraints) {
  if (m_listener == null) {
   return;
  }

  for (int i = 0; i < m_contactCount; ++i) {
   Contact c = m_contacts[i];

   ContactVelocityConstraint vc = constraints[i];
   impulse.count = vc.pointCount;
   for (int j = 0; j < vc.pointCount; ++j) {
    impulse.normalImpulses[j] = vc.points[j].normalImpulse;
    impulse.tangentImpulses[j] = vc.points[j].tangentImpulse;
   }

   m_listener.postSolve(c, impulse);
  }
 }
}
origin: andmizi/MobikeTags

m_contactListener.endContact(c);
origin: org.jbox2d/jbox2d-library

listener.beginContact(this);
listener.endContact(this);
listener.preSolve(this, oldManifold);
origin: com.github.almasb/fxgl-physics

  public void report(ContactVelocityConstraint[] constraints) {
    if (m_listener == null) {
      return;
    }

    for (int i = 0; i < m_contactCount; ++i) {
      Contact c = m_contacts[i];

      ContactVelocityConstraint vc = constraints[i];
      impulse.count = vc.pointCount;
      for (int j = 0; j < vc.pointCount; ++j) {
        impulse.normalImpulses[j] = vc.points[j].normalImpulse;
        impulse.tangentImpulses[j] = vc.points[j].tangentImpulse;
      }

      m_listener.postSolve(c, impulse);
    }
  }
}
org.jbox2d.callbacksContactListener

Javadoc

Implement this class to get contact information. You can use these results for things like sounds and game logic. You can also get contact results by traversing the contact lists after the time step. However, you might miss some contacts because continuous physics leads to sub-stepping. Additionally you may receive multiple callbacks for the same contact in a single time step. You should strive to make your callbacks efficient because there may be many callbacks per time step.

Most used methods

  • beginContact
    Called when two fixtures begin to touch.
  • endContact
    Called when two fixtures cease to touch.
  • postSolve
    This lets you inspect a contact after the solver is finished. This is useful for inspecting impulses
  • preSolve
    This is called after a contact is updated. This allows you to inspect a contact before it goes to th

Popular in Java

  • Running tasks concurrently on multiple threads
  • getResourceAsStream (ClassLoader)
  • getSupportFragmentManager (FragmentActivity)
  • onCreateOptionsMenu (Activity)
  • IOException (java.io)
    Signals a general, I/O-related error. Error details may be specified when calling the constructor, a
  • KeyStore (java.security)
    KeyStore is responsible for maintaining cryptographic keys and their owners. The type of the syste
  • Reference (javax.naming)
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement. A servlet is a small Java program that runs within
  • Options (org.apache.commons.cli)
    Main entry-point into the library. Options represents a collection of Option objects, which describ
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
  • CodeWhisperer alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now