|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.badlogic.gdx.physics.box2d.Shape com.badlogic.gdx.physics.box2d.PolygonShape
public class PolygonShape
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.badlogic.gdx.physics.box2d.Shape |
---|
Shape.Type |
Constructor Summary | |
---|---|
PolygonShape()
Constructs a new polygon |
Method Summary | |
---|---|
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. |
Methods inherited from class com.badlogic.gdx.physics.box2d.Shape |
---|
dispose, getChildCount, getRadius, setRadius |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PolygonShape()
Method Detail |
---|
public Shape.Type getType()
getType
in class Shape
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
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |