public class Polygon extends Object
| Modifier and Type | Field and Description |
|---|---|
Array<Vector2> |
vectorList |
| Modifier and Type | Method and Description |
|---|---|
boolean |
contains(Vector2 p)
Check if a point is in the polygon.
|
static Vector2[] |
float2vec2(float[] f)
Converts a float array to an array of
Vector2. |
float[] |
getEarClippedVertices() |
Vector2 |
getVertex(int i) |
float[] |
getVertices() |
static float[] |
vec2floatArray(Vector2[] v)
|
public Polygon(Vector2[] points)
public Vector2 getVertex(int i)
public float[] getVertices()
public float[] getEarClippedVertices()
public boolean contains(Vector2 p)
p - point coordinatespublic static float[] vec2floatArray(Vector2[] v)
Vector2 to an array of Float values.
The output array contains the x and the y values of the original Vector2,
each one after the other.v - the array of vector to convertfor the opposite operationpublic static Vector2[] float2vec2(float[] f)
Vector2.
The input array must contains the x value first, then the y value.f - coordinates of each vectors (x and y values)for the opposite operationCopyright © 2014-2016 gdx2d - https://github.com/hevs-isi/gdx2d