Tabnine Logo
WorldManifold.getNumberOfContactPoints
Code IndexAdd Tabnine to your IDE (free)

How to use
getNumberOfContactPoints
method
in
com.badlogic.gdx.physics.box2d.WorldManifold

Best Java code snippets using com.badlogic.gdx.physics.box2d.WorldManifold.getNumberOfContactPoints (Showing top 6 results out of 315)

origin: libgdx/libgdx

private void drawContact (Contact contact) {
  WorldManifold worldManifold = contact.getWorldManifold();
  if (worldManifold.getNumberOfContactPoints() == 0) return;
  Vector2 point = worldManifold.getPoints()[0];
  renderer.point(point.x, point.y, 0);
}
origin: libgdx/libgdx

private void drawContact (Contact contact) {
  WorldManifold worldManifold = contact.getWorldManifold();
  if (worldManifold.getNumberOfContactPoints() == 0) return;
  Vector2 point = worldManifold.getPoints()[0];
  renderer.setColor(getColorByBody(contact.getFixtureA().getBody()));
  renderer.point(point.x, point.y, 0);
}
origin: libgdx/libgdx

private boolean isPlayerGrounded (float deltaTime) {
  groundedPlatform = null;
  Array<Contact> contactList = world.getContactList();
  for (int i = 0; i < contactList.size; i++) {
    Contact contact = contactList.get(i);
    if (contact.isTouching()
      && (contact.getFixtureA() == playerSensorFixture || contact.getFixtureB() == playerSensorFixture)) {
      Vector2 pos = player.getPosition();
      WorldManifold manifold = contact.getWorldManifold();
      boolean below = true;
      for (int j = 0; j < manifold.getNumberOfContactPoints(); j++) {
        below &= (manifold.getPoints()[j].y < pos.y - 1.5f);
      }
      if (below) {
        if (contact.getFixtureA().getUserData() != null && contact.getFixtureA().getUserData().equals("p")) {
          groundedPlatform = (Platform)contact.getFixtureA().getBody().getUserData();
        }
        if (contact.getFixtureB().getUserData() != null && contact.getFixtureB().getUserData().equals("p")) {
          groundedPlatform = (Platform)contact.getFixtureB().getBody().getUserData();
        }
        return true;
      }
      return false;
    }
  }
  return false;
}
origin: libgdx/libgdx

int numContactPoints = manifold.getNumberOfContactPoints();
for (int j = 0; j < numContactPoints; j++) {
  Vector2 point = manifold.getPoints()[j];
origin: com.badlogicgames.gdx/gdx-box2d

private void drawContact (Contact contact) {
  WorldManifold worldManifold = contact.getWorldManifold();
  if (worldManifold.getNumberOfContactPoints() == 0) return;
  Vector2 point = worldManifold.getPoints()[0];
  renderer.setColor(getColorByBody(contact.getFixtureA().getBody()));
  renderer.point(point.x, point.y, 0);
}
origin: manuelbua/uracer-kotd

Vector2[] pts = contact.getWorldManifold().getPoints();
int num_points = contact.getWorldManifold().getNumberOfContactPoints();
for (int i = 0; i < num_points; i++) {
  Vector2 lp = fcar.getBody().getLocalPoint(pts[i]);
com.badlogic.gdx.physics.box2dWorldManifoldgetNumberOfContactPoints

Popular methods of WorldManifold

  • getPoints
    Returns the contact points of this manifold. Use getNumberOfContactPoints to determine how many cont

Popular in Java

  • Start an intent from android
  • addToBackStack (FragmentTransaction)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • getSystemService (Context)
  • InetAddress (java.net)
    An Internet Protocol (IP) address. This can be either an IPv4 address or an IPv6 address, and in pra
  • URLEncoder (java.net)
    This class is used to encode a string using the format required by application/x-www-form-urlencoded
  • ResultSet (java.sql)
    An interface for an object which represents a database table entry, returned as the result of the qu
  • DecimalFormat (java.text)
    A concrete subclass of NumberFormat that formats decimal numbers. It has a variety of features desig
  • HttpServletRequest (javax.servlet.http)
    Extends the javax.servlet.ServletRequest interface to provide request information for HTTP servlets.
  • JList (javax.swing)
  • Top plugins for Android Studio
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