Package org.jbox2d.collision
Class Distance
java.lang.Object
org.jbox2d.collision.Distance
public class Distance
extends java.lang.Object
This is non-static for faster pooling. To get an instance, use the
, don't
construct a distance object.
invalid reference
SingletonPool
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic class
A distance proxy is used by the GJK algorithm.private class
static class
Used to warm start Distance.private class
GJK using Voronoi regions (Christer Ericson) and Barycentric coordinates. -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate Vec2
private Vec2
static int
static int
static int
private Vec2
private int[]
private int[]
private Distance.Simplex
private Vec2
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal void
distance
(DistanceOutput output, Distance.SimplexCache cache, DistanceInput input) Compute the closest points between two shapes.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
GJK_CALLS
public static int GJK_CALLS -
GJK_ITERS
public static int GJK_ITERS -
GJK_MAX_ITERS
public static int GJK_MAX_ITERS -
simplex
-
saveA
private int[] saveA -
saveB
private int[] saveB -
closestPoint
-
d
-
temp
-
normal
-
-
Constructor Details
-
Distance
public Distance()
-
-
Method Details
-
distance
Compute the closest points between two shapes. Supports any combination of: CircleShape and PolygonShape. The simplex cache is input/output. On the first call set SimplexCache.count to zero.- Parameters:
output
-cache
-input
-
-