|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.util.nonconvex.Polygon
public class Polygon
This code is very old and doesn't work anymore. Will be updated for 2.0 soon...
Field Summary | |
---|---|
static int |
maxVerticesPerPolygon
|
int |
nVertices
|
float[] |
x
|
float[] |
y
|
Constructor Summary | |
---|---|
Polygon(float[] _x,
float[] _y)
|
|
Polygon(org.jbox2d.util.nonconvex.Triangle t)
|
|
Polygon(Vec2[] v)
|
Method Summary | |
---|---|
Polygon |
add(org.jbox2d.util.nonconvex.Triangle t)
|
void |
addTo(PolygonDef pd)
|
static Polygon |
convexHull(float[] cloudX,
float[] cloudY)
|
static Polygon |
convexHull(float[] cloudX,
float[] cloudY,
int nVert)
|
static Polygon |
convexHull(Vec2[] v)
Find the convex hull of a point cloud using "Gift-wrap" algorithm - start with an extremal point, and walk around the outside edge by testing angles. |
static Polygon |
convexHull(Vec2[] v,
int nVert)
|
static Polygon[] |
decomposeConvex(Polygon p)
Decomposes a non-convex polygon into a number of convex polygons. |
static void |
decomposeConvexAndAddTo(Polygon p,
BodyDef bd,
PolygonDef prototype)
Decomposes a polygon into convex polygons and adds all pieces to BodyDef using a prototype PolyDef. |
Vec2[] |
getVertexVecs()
|
boolean |
isConvex()
|
boolean |
isSimple()
|
static Polygon[] |
polygonizeTriangles(org.jbox2d.util.nonconvex.Triangle[] triangulated)
Turns a list of triangles into a list of convex polygons. |
void |
set(Polygon p)
|
static org.jbox2d.util.nonconvex.Triangle[] |
triangulatePolygon(float[] xv,
float[] yv,
int vNum)
Triangulates a polygon using simple O(N^2) ear-clipping algorithm. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static int maxVerticesPerPolygon
public float[] x
public float[] y
public int nVertices
Constructor Detail |
---|
public Polygon(float[] _x, float[] _y)
public Polygon(Vec2[] v)
public Polygon(org.jbox2d.util.nonconvex.Triangle t)
Method Detail |
---|
public Vec2[] getVertexVecs()
public void set(Polygon p)
public boolean isConvex()
public boolean isSimple()
public Polygon add(org.jbox2d.util.nonconvex.Triangle t)
public void addTo(PolygonDef pd)
public static org.jbox2d.util.nonconvex.Triangle[] triangulatePolygon(float[] xv, float[] yv, int vNum)
public static Polygon[] polygonizeTriangles(org.jbox2d.util.nonconvex.Triangle[] triangulated)
public static Polygon[] decomposeConvex(Polygon p)
public static void decomposeConvexAndAddTo(Polygon p, BodyDef bd, PolygonDef prototype)
public static Polygon convexHull(Vec2[] v)
public static Polygon convexHull(Vec2[] v, int nVert)
public static Polygon convexHull(float[] cloudX, float[] cloudY)
public static Polygon convexHull(float[] cloudX, float[] cloudY, int nVert)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |