CatmullRom2
class CatmullRom2(val p0: Vector2, val p1: Vector2, val p2: Vector2, val p3: Vector2, val alpha: Double = 0.5)(source)
Creates a 2D Catmull-Rom spline curve.
Can be represented as a segment drawn between p1 and p2, while p0 and p3 are used as control points.
Under some circumstances alpha can have no perceptible effect, for example, when creating closed shapes with the vertices forming a regular 2D polygon.
Parameters
p0
The first control point.
p1
The starting anchor point.
p2
The ending anchor point.
p3
The second control point.
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.