Spline

Spline

Describes a cubic spline

Constructor

new Spline(controlPoints)

Parameters:
Name Type Description
controlPoints Array.<Vector>

Methods

(static) cubicInterpolation(p0, p1, p2, p3, t, store)

Interpolate on a quadratic Bezier curve

Parameters:
Name Type Description
p0 Vector

First control point

p1 Vector

Second control point

p2 Vector

Third control point

p3 Vector

Fourth control point

t number

Takes values between 0 and 1

store Vector

Vector to store the result to

(static) getPointsAlongCubicBezierCurve(controlPoints, nSegments) → {Array.<Vector3>}

Gets (nSegments + 1) number of interpolated points along the cubic bezier curve defined by the control points.

Parameters:
Name Type Description
controlPoints Array.<Vector3>

The four control points.

nSegments number

The number of segments used to draw the resulting spline.

(static) quadraticInterpolation(p0, p1, p2, t, store)

Interpolate on a quadratic Bezier curve

Parameters:
Name Type Description
p0 Vector

First control point

p1 Vector

Second control point

p2 Vector

Third control point

t number

Takes values between 0 and 1

store Vector

Vector to store the result to

getPoint(t, store)

Stores the coordinates of the point on the spline at a given t

Parameters:
Name Type Description
t number

Takes values between 0 and 1

store Vector

A vector to store the result in