SplineWalker

SplineWalker

Provides a way to interpolate on a spline with constant speed

Constructor

new SplineWalker(spline, substepSizeopt)

Parameters:
Name Type Attributes Default Description
spline Spline

Spline to interpolate across

substepSize number <optional>
0.01

substepSize The size of the substep used to approximate movement across the spline.
Small values of this parameter lead to more substeps and better precision (at the cost of more computations).

Methods

advance(distance, store)

Advances the walker by the provided distance and store the new location in the second parameter

Parameters:
Name Type Description
distance number

Distance to "walk" on the spline; must be positive

store Vector

The vector to use to store the resulting position; must have the same type as the control points of the spline

canWalk() → {boolean}

Returns whether the walker can still advance on the spline