congrats Icon
New! Announcing Tabnine Chat Beta
Learn More
Tabnine Logo
org.jbox2d.collision
Code IndexAdd Tabnine to your IDE (free)

How to use org.jbox2d.collision

Best Java code snippets using org.jbox2d.collision (Showing top 20 results out of 315)

origin: libgdx/libgdx

public void writeCache(SimplexCache cache) {
 cache.metric = getMetric();
 cache.count = m_count;
 for (int i = 0; i < m_count; ++i) {
  cache.indexA[i] = (vertices[i].indexA);
  cache.indexB[i] = (vertices[i].indexB);
 }
}
origin: libgdx/libgdx

public EPCollider() {
 for (int i = 0; i < 2; i++) {
  ie[i] = new ClipVertex();
  clipPoints1[i] = new ClipVertex();
  clipPoints2[i] = new ClipVertex();
 }
}
origin: libgdx/libgdx

 @Override
 public int compareTo(ContactID o) {
  return getKey() - o.getKey();
 }
}
origin: libgdx/libgdx

public DefaultWorldPool(int argSize, int argContainerSize) {
 vecs = new OrderedStack<Vec2>(argSize, argContainerSize) {
  protected Vec2 newInstance() { return new Vec2(); }
 };
 vec3s = new OrderedStack<Vec3>(argSize, argContainerSize) {
  protected Vec3 newInstance() { return new Vec3(); }
 };
 mats = new OrderedStack<Mat22>(argSize, argContainerSize) {
  protected Mat22 newInstance() { return new Mat22(); }
 };
 aabbs = new OrderedStack<AABB>(argSize, argContainerSize) {
  protected AABB newInstance() { return new AABB(); }
 };
 rots = new OrderedStack<Rot>(argSize, argContainerSize) {
  protected Rot newInstance() { return new Rot(); }
 };
 mat33s = new OrderedStack<Mat33>(argSize, argContainerSize) {
  protected Mat33 newInstance() { return new Mat33(); }
 };
 dist = new Distance();
 collision = new Collision(this);
 toi = new TimeOfImpact(this);
}
origin: libgdx/libgdx

 protected AABB newInstance() { return new AABB(); }
};
origin: libgdx/libgdx

/**
 * Blank manifold point with everything zeroed out.
 */
public ManifoldPoint() {
  localPoint = new Vec2();
  normalImpulse = tangentImpulse = 0f;
  id = new ContactID();
}
origin: libgdx/libgdx

/**
 * @deprecated please use {@link #raycast(RayCastOutput, RayCastInput, IWorldPool)} for better
 *             performance
 * @param output
 * @param input
 * @return
 */
public final boolean raycast(final RayCastOutput output, final RayCastInput input) {
 return raycast(output, input, new DefaultWorldPool(4, 4));
}
origin: libgdx/libgdx

public ContactID(final ContactID c) {
 set(c);
}
origin: libgdx/libgdx

@Override
public float getAreaRatio() {
 if (m_root == NULL_NODE) {
  return 0.0f;
 }
 final int root = m_root;
 float rootArea = m_aabb[root].getPerimeter();
 float totalArea = 0.0f;
 for (int i = 0; i < m_nodeCapacity; ++i) {
  if (m_height[i] < 0) {
   // Free node in pool
   continue;
  }
  totalArea += m_aabb[i].getPerimeter();
 }
 return totalArea / rootArea;
}
origin: libgdx/libgdx

public void collideEdgeAndPolygon(Manifold manifold, final EdgeShape edgeA, final Transform xfA,
  final PolygonShape polygonB, final Transform xfB) {
 collider.collide(manifold, edgeA, xfA, polygonB, xfB);
}
origin: libgdx/libgdx

/**
 * creates a manifold with 0 points, with it's points array full of instantiated ManifoldPoints.
 */
public Manifold() {
 points = new ManifoldPoint[Settings.maxManifoldPoints];
 for (int i = 0; i < Settings.maxManifoldPoints; i++) {
  points[i] = new ManifoldPoint();
 }
 localNormal = new Vec2();
 localPoint = new Vec2();
 pointCount = 0;
}
origin: libgdx/libgdx

protected Contact(IWorldPool argPool) {
 m_fixtureA = null;
 m_fixtureB = null;
 m_nodeA = new ContactEdge();
 m_nodeB = new ContactEdge();
 m_manifold = new Manifold();
 pool = argPool;
}
origin: libgdx/libgdx

 /**
  * copies this manifold from the given one
  * 
  * @param cp manifold to copy from
  */
 public void set(Manifold cp) {
  for (int i = 0; i < cp.pointCount; i++) {
   points[i].set(cp.points[i]);
  }

  type = cp.type;
  localNormal.set(cp.localNormal);
  localPoint.set(cp.localPoint);
  pointCount = cp.pointCount;
 }
}
origin: libgdx/libgdx

public boolean isEqual(final ContactID cid) {
 return getKey() == cid.getKey();
}
origin: libgdx/libgdx

/**
 * Creates a manifold point as a copy of the given point
 * @param cp point to copy from
 */
public ManifoldPoint(final ManifoldPoint cp) {
  localPoint = cp.localPoint.clone();
  normalImpulse = cp.normalImpulse;
  tangentImpulse = cp.tangentImpulse;
  id = new ContactID(cp.id);
}
origin: libgdx/libgdx

public Collision(IWorldPool argPool) {
 incidentEdge[0] = new ClipVertex();
 incidentEdge[1] = new ClipVertex();
 clipPoints1[0] = new ClipVertex();
 clipPoints1[1] = new ClipVertex();
 clipPoints2[0] = new ClipVertex();
 clipPoints2[1] = new ClipVertex();
 pool = argPool;
}
origin: libgdx/libgdx

  /**
   * Sets this manifold point form the given one
   * @param cp the point to copy from
   */
  public void set(final ManifoldPoint cp){
    localPoint.set(cp.localPoint);
    normalImpulse = cp.normalImpulse;
    tangentImpulse = cp.tangentImpulse;
    id.set(cp.id);
  }
}
origin: libgdx/libgdx

@Override
public float getAreaRatio() {
 if (m_root == null) {
  return 0.0f;
 }
 final DynamicTreeNode root = m_root;
 float rootArea = root.aabb.getPerimeter();
 float totalArea = 0.0f;
 for (int i = 0; i < m_nodeCapacity; ++i) {
  final DynamicTreeNode node = m_nodes[i];
  if (node.height < 0) {
   // Free node in pool
   continue;
  }
  totalArea += node.aabb.getPerimeter();
 }
 return totalArea / rootArea;
}
origin: libgdx/libgdx

public ManifoldPoint[] getPoints () {
  for (int i = 0; i < manifold.points.length; i++) {
    points[i].contactID = manifold.points[i].id.getKey();
    points[i].localPoint.set(manifold.points[i].localPoint.x, manifold.points[i].localPoint.y);
    points[i].normalImpulse = manifold.points[i].normalImpulse;
    points[i].tangentImpulse = manifold.points[i].tangentImpulse;
  }
  return points;
}
origin: libgdx/libgdx

public ClipVertex() {
 v = new Vec2();
 id = new ContactID();
}
org.jbox2d.collision

Most used classes

  • PolygonShape
    A convex polygon shape. Polygons have a maximum number of vertices equal to _maxPolygonVertices. In
  • CircleShape
    A circle shape.
  • ChainShape
    A chain shape is a free form sequence of line segments. The chain has two-sided collision, so you ca
  • EdgeShape
  • Shape
    A shape is used for collision detection. You can create a shape however you like. Shapes used for si
  • MassData,
  • Collision,
  • Distance$DistanceProxy,
  • Distance,
  • BroadPhaseStrategy,
  • DynamicTree,
  • DynamicTreeFlatNodes,
  • Collision$ClipVertex,
  • Collision$EPCollider,
  • ContactID$Type,
  • ContactID,
  • Distance$Simplex,
  • Distance$SimplexVertex,
  • Manifold
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