Example usage for Java com.badlogic.gdx.math Polygon fields, constructors, methods, implement or subclass
The text is from its open source code.
boolean | dirty |
Polygon() Constructs a new polygon with no vertices. | |
Polygon(float[] vertices) Constructs a new polygon from a float array of parts of vertex points. |
float | area() Returns the area contained within the polygon. |
boolean | contains(float x, float y) Returns whether an x, y pair is contained within the polygon. |
Rectangle | getBoundingRectangle() Returns an axis-aligned bounding box of this polygon. |
float | getScaleX() Returns the total horizontal scaling applied to the polygon. |
float | getScaleY() Returns the total vertical scaling applied to the polygon. |
float[] | getTransformedVertices() Calculates and returns the vertices of the polygon after scaling, rotation, and positional translations have been applied, as they are position within the world. |
float[] | getVertices() Returns the polygon's local vertices without scaling or rotation and without being offset by the polygon position. |
float | getX() Returns the x-coordinate of the polygon's position within the world. |
float | getY() Returns the y-coordinate of the polygon's position within the world. |
void | setOrigin(float originX, float originY) Sets the origin point to which all of the polygon's local vertices are relative to. |
void | setPosition(float x, float y) Sets the polygon's position within the world. |
void | setRotation(float degrees) Sets the polygon to be rotated by the supplied degrees. |
void | setScale(float scaleX, float scaleY) Sets the amount of scaling to be applied to the polygon. |
void | setVertices(float[] vertices) Sets the polygon's local vertices relative to the origin point, without any scaling, rotating or translations being applied. |
void | translate(float x, float y) Translates the polygon's position by the specified horizontal and vertical amounts. |