Package org.jbox2d.collision
Class Distance.DistanceProxy
- java.lang.Object
-
- org.jbox2d.collision.Distance.DistanceProxy
-
- Enclosing class:
- Distance
public static class Distance.DistanceProxy extends java.lang.Object
A distance proxy is used by the GJK algorithm. It encapsulates any shape. TODO: see if we can just do assignments with m_vertices, instead of copying stuff over
-
-
Constructor Summary
Constructors Constructor Description DistanceProxy()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getSupport(Vec2 d)
Get the supporting vertex index in the given direction.Vec2
getSupportVertex(Vec2 d)
Get the supporting vertex in the given direction.Vec2
getVertex(int index)
Get a vertex by index.int
getVertexCount()
Get the vertex count.void
set(Shape shape, int index)
Initialize the proxy using the given shape.
-
-
-
Method Detail
-
set
public final void set(Shape shape, int index)
Initialize the proxy using the given shape. The shape must remain in scope while the proxy is in use.
-
getSupport
public final int getSupport(Vec2 d)
Get the supporting vertex index in the given direction.- Parameters:
d
-- Returns:
-
getSupportVertex
public final Vec2 getSupportVertex(Vec2 d)
Get the supporting vertex in the given direction.- Parameters:
d
-- Returns:
-
getVertexCount
public final int getVertexCount()
Get the vertex count.- Returns:
-
getVertex
public final Vec2 getVertex(int index)
Get a vertex by index. Used by Distance.- Parameters:
index
-- Returns:
-
-