|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.jbox2d.collision.shapes.ShapeDef
org.jbox2d.collision.shapes.PolygonDef
public class PolygonDef
Convex polygon. The vertices must be in CCW order for a right-handed coordinate system with the z-axis coming out of the screen. Add vertices using PolygonDef.add(Vec2), and create the polygon shape using Body::createShape(ShapeDef).
Field Summary | |
---|---|
List<Vec2> |
vertices
The polygon vertices in local coordinates. |
Fields inherited from class org.jbox2d.collision.shapes.ShapeDef |
---|
density, filter, friction, isSensor, restitution, type, userData |
Constructor Summary | |
---|---|
PolygonDef()
|
Method Summary | |
---|---|
void |
addVertex(Vec2 v)
Add a vertex to the polygon. |
void |
clearVertices()
Removes all vertices. |
Vec2[] |
getVertexArray()
Return the vertex list as an array. |
int |
getVertexCount()
Return the number of vertices. |
List<Vec2> |
getVertexList()
Return the vertex list as a List |
void |
set(PolygonDef copyMe)
|
void |
setAsBox(float hx,
float hy)
Build vertices to represent an axis-aligned box. |
void |
setAsBox(float hx,
float hy,
Vec2 center,
float angle)
Build vertices to represent an oriented box. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public List<Vec2> vertices
Constructor Detail |
---|
public PolygonDef()
Method Detail |
---|
public void set(PolygonDef copyMe)
public void addVertex(Vec2 v)
public void clearVertices()
public Vec2[] getVertexArray()
public List<Vec2> getVertexList()
public void setAsBox(float hx, float hy)
hx
- the half-width.hy
- the half-height.public void setAsBox(float hx, float hy, Vec2 center, float angle)
hx
- the half-width.hy
- the half-height.center
- the center of the box in local coordinates.angle
- the rotation of the box in local coordinates.public int getVertexCount()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |