Codota Logo
WorldManifold
Code IndexAdd Codota to your IDE (free)

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

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

  • Common ways to obtain WorldManifold
private void myMethod () {
WorldManifold w =
  • Codota IconContact contact;contact.getWorldManifold()
  • Smart code suggestions by Codota
}
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: stackoverflow.com

int numPoints = contact.getWorldManifold().getNumberOfContactPoints();
for(int i = 0; i < numPoints; i++){
  Vector2 vector2 = ballBody.getLinearVelocityFromWorldPoint(worldManiFold.getPoints()[i]);
  if(vector2.y < 0) {
    contact.setEnabled(false);
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];
  renderer.point(point.x, point.y, 0);
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

float ml = car.getCarModel().length;
float half_ml = ml * 0.5f;
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.box2dWorldManifold

Javadoc

This is used to compute the current state of a contact manifold.

Most used methods

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

Popular in Java

  • Creating JSON documents from java classes using gson
  • requestLocationUpdates (LocationManager)
  • getSupportFragmentManager (FragmentActivity)
  • getContentResolver (Context)
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • TreeMap (java.util)
    A Red-Black tree based NavigableMap implementation. The map is sorted according to the Comparable of
  • JComboBox (javax.swing)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now