MorphWeightSpline

A spline that linearly interpolates over an array of weight values used by morph targets.

const times = [ 0.0, 1.5, 3.0, 4.5, 6.0 ];
const weights = [0.0, 1.0, 0.25, 0.75, 0.5, 0.5, 0.75, 0.25, 1.0, 0.0]; //Two targets
const spline = new WeightSpline({
times : times,
weights : weights
});

const p0 = spline.evaluate(times[0]);

See also

Constructors

Link copied to clipboard

Types

Link copied to clipboard
sealed interface ConstructorOptions

Functions

Link copied to clipboard
fun clampTime(time: Double): Double

Clamps the given time to the period covered by the spline.

Link copied to clipboard
fun evaluate(time: Double, result: ReadonlyArray<Double>? = definedExternally): ReadonlyArray<Double>

Evaluates the curve at a given time.

Link copied to clipboard

Finds an index i in times such that the parameter time is in the interval [times[i], times[i + 1]].

Link copied to clipboard
fun wrapTime(time: Double): Double

Wraps the given time to the period covered by the spline.