Package com.badlogic.gdx.math
Class Polyline
- java.lang.Object
-
- com.badlogic.gdx.math.Polyline
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
calculateLength()
void
calculateScaledLength()
boolean
contains(float x, float y)
Returns whether a point with the given coordinates is contained within the shape.boolean
contains(Vector2 point)
Returns whether the given point is contained within the shape.void
dirty()
Rectangle
getBoundingRectangle()
Returns an axis-aligned bounding box of this polyline.float
getLength()
Returns the euclidean length of the polyline without scalingfloat
getOriginX()
float
getOriginY()
float
getRotation()
float
getScaledLength()
Returns the euclidean length of the polylinefloat
getScaleX()
float
getScaleY()
float[]
getTransformedVertices()
Returns vertices scaled, rotated, and offset by the polygon position.float[]
getVertices()
Returns vertices without scaling or rotation and without being offset by the polyline position.float
getX()
float
getY()
void
rotate(float degrees)
void
scale(float amount)
void
setOrigin(float originX, float originY)
void
setPosition(float x, float y)
void
setRotation(float degrees)
void
setScale(float scaleX, float scaleY)
void
setVertices(float[] vertices)
void
translate(float x, float y)
-
-
-
Method Detail
-
getVertices
public float[] getVertices()
Returns vertices without scaling or rotation and without being offset by the polyline position.
-
getTransformedVertices
public float[] getTransformedVertices()
Returns vertices scaled, rotated, and offset by the polygon position.
-
getLength
public float getLength()
Returns the euclidean length of the polyline without scaling
-
getScaledLength
public float getScaledLength()
Returns the euclidean length of the polyline
-
getX
public float getX()
-
getY
public float getY()
-
getOriginX
public float getOriginX()
-
getOriginY
public float getOriginY()
-
getRotation
public float getRotation()
-
getScaleX
public float getScaleX()
-
getScaleY
public float getScaleY()
-
setOrigin
public void setOrigin(float originX, float originY)
-
setPosition
public void setPosition(float x, float y)
-
setVertices
public void setVertices(float[] vertices)
-
setRotation
public void setRotation(float degrees)
-
rotate
public void rotate(float degrees)
-
setScale
public void setScale(float scaleX, float scaleY)
-
scale
public void scale(float amount)
-
calculateLength
public void calculateLength()
-
calculateScaledLength
public void calculateScaledLength()
-
dirty
public void dirty()
-
translate
public void translate(float x, float y)
-
getBoundingRectangle
public Rectangle getBoundingRectangle()
Returns an axis-aligned bounding box of this polyline. Note the returned Rectangle is cached in this polyline, and will be reused if this Polyline is changed.- Returns:
- this polyline's bounding box
Rectangle
-
contains
public boolean contains(Vector2 point)
Description copied from interface:Shape2D
Returns whether the given point is contained within the shape.
-
-