Polyline¶
-
php\gdx\math\Polyline
Class Polyline
Methods
__construct
($vertices)¶
Parameters:
- $vertices – array - (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:
- $originX – float
- $originY – float
setPosition
($x, $y)¶Sets the polyline’s position within the world.
Parameters:
- $x – float
- $y – float
setVertices
($vertices)¶
Parameters:
- $vertices – array
translate
($x, $y)¶Translates the polyline’s position by the specified horizontal and vertical amounts.
Parameters:
- $x – float
- $y – float
setRotation
($degrees)¶Sets the polyline to be rotated by the supplied degrees.
Parameters:
- $degrees – float
rotate
($degrees)¶Applies additional rotation to the polyline by the supplied degrees.
Parameters:
- $degrees – float
setScale
($scaleX, $scaleY)¶Sets the amount of scaling to be applied to the polyline.
Parameters:
- $scaleX – float
- $scaleY – float
scale
($amount)¶Applies additional scaling to the polyline by the supplied amount.
Parameters:
- $amount – float
getX
()¶
Returns: float
getY
()¶
Returns: float
getOriginX
()¶
Returns: float
getOriginY
()¶
Returns: float
getRotation
()¶
Returns: float
getScaleX
()¶
Returns: float
getScaleY
()¶
Returns: float