Java com.badlogic.gdx.math Polygon fields, constructors, methods, implement or subclass

Example usage for Java com.badlogic.gdx.math Polygon fields, constructors, methods, implement or subclass

Introduction

In this page you can find the methods, fields and constructors for com.badlogic.gdx.math Polygon.

The text is from its open source code.

Field

booleandirty

Constructor

Polygon()
Constructs a new polygon with no vertices.
Polygon(float[] vertices)
Constructs a new polygon from a float array of parts of vertex points.

Method

floatarea()
Returns the area contained within the polygon.
booleancontains(float x, float y)
Returns whether an x, y pair is contained within the polygon.
RectanglegetBoundingRectangle()
Returns an axis-aligned bounding box of this polygon.
floatgetScaleX()
Returns the total horizontal scaling applied to the polygon.
floatgetScaleY()
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.
floatgetX()
Returns the x-coordinate of the polygon's position within the world.
floatgetY()
Returns the y-coordinate of the polygon's position within the world.
voidsetOrigin(float originX, float originY)
Sets the origin point to which all of the polygon's local vertices are relative to.
voidsetPosition(float x, float y)
Sets the polygon's position within the world.
voidsetRotation(float degrees)
Sets the polygon to be rotated by the supplied degrees.
voidsetScale(float scaleX, float scaleY)
Sets the amount of scaling to be applied to the polygon.
voidsetVertices(float[] vertices)
Sets the polygon's local vertices relative to the origin point, without any scaling, rotating or translations being applied.
voidtranslate(float x, float y)
Translates the polygon's position by the specified horizontal and vertical amounts.