public class PolygonShape extends Shape
Shape.Type
Modifier | Constructor and Description |
---|---|
|
PolygonShape()
Constructs a new polygon
|
protected |
PolygonShape(long addr) |
Modifier and Type | Method and Description |
---|---|
Shape.Type |
getType()
Get the type of this shape.
|
void |
getVertex(int index,
Vector2 vertex)
Returns the vertex at the given position.
|
int |
getVertexCount() |
void |
set(float[] vertices)
Copy vertices from the given float array.
|
void |
set(float[] vertices,
int offset,
int len)
Copy vertices from the given float array, taking into account the offset and length.
|
void |
set(Vector2[] vertices)
Copy vertices.
|
void |
setAsBox(float hx,
float hy)
Build vertices to represent an axis-aligned box.
|
void |
setAsBox(float hx,
float hy,
Vector2 center,
float angle)
Build vertices to represent an oriented box.
|
dispose, getChildCount, getRadius, jniGetType, setRadius
public PolygonShape()
protected PolygonShape(long addr)
public Shape.Type getType()
public void set(Vector2[] vertices)
public void set(float[] vertices)
public void set(float[] vertices, int offset, int len)
public void setAsBox(float hx, float hy)
hx
- the half-width.hy
- the half-height.public void setAsBox(float hx, float hy, Vector2 center, float angle)
hx
- the half-width.hy
- the half-height.center
- the center of the box in local coordinates.angle
- the rotation in radians of the box in local coordinates.public int getVertexCount()
public void getVertex(int index, Vector2 vertex)
index
- the index of the vertex 0 <= index < getVertexCount( )vertex
- vertex