CatmullRomChain2

class CatmullRomChain2(points: List<Vector2>, alpha: Double = 0.5, val loop: Boolean = false)(source)

Calculates the 2D Catmull–Rom spline for a chain of points and returns the combined curve.

For more details, see CatmullRom2.

Parameters

points

The List of 2D points where CatmullRom2 is applied in groups of 4.

alpha

The tension of the curve. Use 0.0 for the uniform spline, 0.5 for the centripetal spline, 1.0 for the chordal spline.

loop

Whether to connect the first and last point, such that it forms a closed shape.

Constructors

Link copied to clipboard
constructor(points: List<Vector2>, alpha: Double = 0.5, loop: Boolean = false)

Properties

Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
fun position(rt: Double): Vector2
Link copied to clipboard
fun positions(steps: Int = segments.size * 4): List<Vector2>
Link copied to clipboard
fun CatmullRomChain2.toContour(): ShapeContour

Converts chain to a ShapeContour.