APIdia Launch Partner
Top Fields Constructors Methods
com.badlogic.gdx.math

public Class Polyline

extends Object
implements Shape2D
Class Inheritance
All Implemented Interfaces
com.badlogic.gdx.math.Shape2D

Field Summary

Modifier and TypeField and Description
private Rectangle
private boolean
private boolean
private boolean
private float
private float[]
private float
private float
private float
private float
private float
private float
private float[]
private float
x

private float
y

Constructor Summary

AccessConstructor and Description
public
public
Polyline(float[] vertices)

Method Summary

Modifier and TypeMethod and Description
public void
public void
public boolean
contains(Vector2 point)

Implements com.badlogic.gdx.math.Shape2D.contains.

Returns whether the given point is contained within the shape.

public boolean
contains(float x, float y)

Implements com.badlogic.gdx.math.Shape2D.contains.

Returns whether a point with the given coordinates is contained within the shape.

public void
public Rectangle

Returns:

this polyline's bounding box Rectangle
getBoundingRectangle
()

Returns an axis-aligned bounding box of this polyline.

public float
getLength()

Returns the euclidean length of the polyline without scaling

public float
public float
public float
public float
getScaledLength()

Returns the euclidean length of the polyline

public float
public float
public float[]
getTransformedVertices()

Returns vertices scaled, rotated, and offset by the polygon position.

public float[]
getVertices()

Returns vertices without scaling or rotation and without being offset by the polyline position.

public float
getX()

public float
getY()

public void
rotate(float degrees)

public void
scale(float amount)

public void
setOrigin(float originX, float originY)

public void
setPosition(float x, float y)

public void
setRotation(float degrees)

public void
setScale(float scaleX, float scaleY)

public void
setVertices(float[] vertices)

public void
translate(float x, float y)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

boundsback to summary
private Rectangle bounds
calculateLengthback to summary
private boolean calculateLength
calculateScaledLengthback to summary
private boolean calculateScaledLength
dirtyback to summary
private boolean dirty
lengthback to summary
private float length
localVerticesback to summary
private float[] localVertices
originXback to summary
private float originX
originYback to summary
private float originY
rotationback to summary
private float rotation
scaledLengthback to summary
private float scaledLength
scaleXback to summary
private float scaleX
scaleYback to summary
private float scaleY
worldVerticesback to summary
private float[] worldVertices
xback to summary
private float x
yback to summary
private float y

Constructor Detail

Polylineback to summary
public Polyline()
Polylineback to summary
public Polyline(float[] vertices)

Method Detail

calculateLengthback to summary
public void calculateLength()
calculateScaledLengthback to summary
public void calculateScaledLength()
containsback to summary
public boolean contains(Vector2 point)

Implements com.badlogic.gdx.math.Shape2D.contains.

Doc from com.badlogic.gdx.math.Shape2D.contains.

Returns whether the given point is contained within the shape.

Annotations
@Override
containsback to summary
public boolean contains(float x, float y)

Implements com.badlogic.gdx.math.Shape2D.contains.

Doc from com.badlogic.gdx.math.Shape2D.contains.

Returns whether a point with the given coordinates is contained within the shape.

Annotations
@Override
dirtyback to summary
public void dirty()
getBoundingRectangleback to summary
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:Rectangle

this polyline's bounding box Rectangle

getLengthback to summary
public float getLength()

Returns the euclidean length of the polyline without scaling

getOriginXback to summary
public float getOriginX()
getOriginYback to summary
public float getOriginY()
getRotationback to summary
public float getRotation()
getScaledLengthback to summary
public float getScaledLength()

Returns the euclidean length of the polyline

getScaleXback to summary
public float getScaleX()
getScaleYback to summary
public float getScaleY()
getTransformedVerticesback to summary
public float[] getTransformedVertices()

Returns vertices scaled, rotated, and offset by the polygon position.

getVerticesback to summary
public float[] getVertices()

Returns vertices without scaling or rotation and without being offset by the polyline position.

getXback to summary
public float getX()
getYback to summary
public float getY()
rotateback to summary
public void rotate(float degrees)
scaleback to summary
public void scale(float amount)
setOriginback to summary
public void setOrigin(float originX, float originY)
setPositionback to summary
public void setPosition(float x, float y)
setRotationback to summary
public void setRotation(float degrees)
setScaleback to summary
public void setScale(float scaleX, float scaleY)
setVerticesback to summary
public void setVertices(float[] vertices)
translateback to summary
public void translate(float x, float y)