Tabnine Logo
Contact.getWorldManifold
Code IndexAdd Tabnine to your IDE (free)

How to use
getWorldManifold
method
in
org.jbox2d.dynamics.contacts.Contact

Best Java code snippets using org.jbox2d.dynamics.contacts.Contact.getWorldManifold (Showing top 5 results out of 315)

origin: libgdx/libgdx

public WorldManifold getWorldManifold () {
  contact.getWorldManifold(worldManifold2);
  int numContactPoints = contact.getManifold().pointCount;
  worldManifold.numContactPoints = numContactPoints;
  worldManifold.normal.set(worldManifold2.normal.x, worldManifold2.normal.y);
  for (int i = 0; i < worldManifold.points.length; i++) {
    worldManifold.points[i] = new Vector2(worldManifold2.points[i].x, worldManifold2.points[i].y);
  }
  return worldManifold;
}
origin: jbox2d/jbox2d

 public void preSolve(Contact contact, Manifold oldManifold) {
  Manifold manifold = contact.getManifold();

  if (manifold.pointCount == 0) {
   return;
  }

  Fixture fixtureA = contact.getFixtureA();
  Fixture fixtureB = contact.getFixtureB();

  Collision.getPointStates(state1, state2, oldManifold, manifold);

  contact.getWorldManifold(worldManifold);

  for (int i = 0; i < manifold.pointCount && pointCount < MAX_CONTACT_POINTS; i++) {
   ContactPoint cp = points[pointCount];
   cp.fixtureA = fixtureA;
   cp.fixtureB = fixtureB;
   cp.position.set(worldManifold.points[i]);
   cp.normal.set(worldManifold.normal);
   cp.state = state2[i];
   cp.normalImpulse = manifold.points[i].normalImpulse;
   cp.tangentImpulse = manifold.points[i].tangentImpulse;
   cp.separation = worldManifold.separations[i];
   ++pointCount;
  }
 }
}
origin: stackoverflow.com

 protected ContactListener createContactListener() {
  return new ContactListener() {
    public void beginContact(Contact contact) {
      Vector2[] contactPoints = contact.getWorldManifold().getPoints();
       for(int i = 0; i < contactPoints.length; i++) {
         ...
       }
       ...
    }
  }
}
origin: stackoverflow.com

 public void beginContact(Contact c) {
  System.out.println("CONTACT");

  WorldManifold worldmanifold;
  worldmanifold = c.getWorldManifold();

  for(Vec2 point : worldmanifold.points){
    System.out.println("Contact at : [" + point.x + ", " + point.y "]");
  }
}
origin: org.jbox2d/jbox2d-testbed

public void preSolve(Contact contact, Manifold oldManifold) {
 Manifold manifold = contact.getManifold();
 if (manifold.pointCount == 0) {
  return;
 }
 Fixture fixtureA = contact.getFixtureA();
 Fixture fixtureB = contact.getFixtureB();
 Collision.getPointStates(state1, state2, oldManifold, manifold);
 contact.getWorldManifold(worldManifold);
 for (int i = 0; i < manifold.pointCount && pointCount < MAX_CONTACT_POINTS; i++) {
  ContactPoint cp = points[pointCount];
  cp.fixtureA = fixtureA;
  cp.fixtureB = fixtureB;
  cp.position.set(worldManifold.points[i]);
  cp.normal.set(worldManifold.normal);
  cp.state = state2[i];
  cp.normalImpulse = manifold.points[i].normalImpulse;
  cp.tangentImpulse = manifold.points[i].tangentImpulse;
  ++pointCount;
 }
}
org.jbox2d.dynamics.contactsContactgetWorldManifold

Javadoc

Get the world manifold.

Popular methods of Contact

  • getFixtureA
    Get the first fixture in this contact.
  • getFixtureB
    Get the second fixture in this contact.
  • setEnabled
    Enable/disable this contact. This can be used inside the pre-solve contact listener. The contact is
  • getManifold
    Get the contact manifold. Do not set the point count to zero. Instead call Disable.
  • evaluate
  • flagForFiltering
    Flag this contact for filtering. Filtering will occur the next time step.
  • getChildIndexA
  • getChildIndexB
  • getNext
    Get the next contact in the world's contact list.
  • init
    initialization for pooling
  • isEnabled
    Has this contact been disabled?
  • isTouching
    Is this contact touching
  • isEnabled,
  • isTouching,
  • mixFriction,
  • mixRestitution,
  • update,
  • setTangentSpeed,
  • getFriction,
  • getRestitution,
  • getTangentSpeed

Popular in Java

  • Running tasks concurrently on multiple threads
  • getContentResolver (Context)
  • onRequestPermissionsResult (Fragment)
  • getSystemService (Context)
  • RandomAccessFile (java.io)
    Allows reading from and writing to a file in a random-access manner. This is different from the uni-
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • Connection (java.sql)
    A connection represents a link from a Java application to a database. All SQL statements and results
  • BoxLayout (javax.swing)
  • JList (javax.swing)
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top PhpStorm plugins
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