Polyline

php\gdx\math\Polyline

Class Polyline

Methods


__construct($vertices)
Parameters:
  • $verticesarray - (optional)
getVertices()

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

Returns:float[]
getTransformedVertices()
Returns:float[] vertices scaled, rotated, and offset by the polyline position.
getLength()
Returns:float Returns the euclidean length of the polyline without scaling
getScaledLength()
Returns:float Returns the euclidean length of the polyline
calculateLength()
calculateScaledLength()
dirty()
setOrigin($originX, $originY)

Sets the origin point to which all of the polyline’s local vertices are relative to.

Parameters:
  • $originXfloat
  • $originYfloat
setPosition($x, $y)

Sets the polyline’s position within the world.

Parameters:
  • $xfloat
  • $yfloat
setVertices($vertices)
Parameters:
  • $verticesarray
translate($x, $y)

Translates the polyline’s position by the specified horizontal and vertical amounts.

Parameters:
  • $xfloat
  • $yfloat
setRotation($degrees)

Sets the polyline to be rotated by the supplied degrees.

Parameters:
  • $degreesfloat
rotate($degrees)

Applies additional rotation to the polyline by the supplied degrees.

Parameters:
  • $degreesfloat
setScale($scaleX, $scaleY)

Sets the amount of scaling to be applied to the polyline.

Parameters:
  • $scaleXfloat
  • $scaleYfloat
scale($amount)

Applies additional scaling to the polyline by the supplied amount.

Parameters:
  • $amountfloat
getX()
Returns:float
getY()
Returns:float
getOriginX()
Returns:float
getOriginY()
Returns:float
getRotation()
Returns:float
getScaleX()
Returns:float
getScaleY()
Returns:float