Class: CurveSet

pc.CurveSet

A curve set is a collection of curves.

Constructor

new CurveSet(curveKeysopt)

Creates a new curve set.
Parameters:
Name Type Attributes Description
curveKeys Array <optional>
An array of arrays of keys (pairs of numbers with the time first and value second).
Source:

Members

(readonly) length :Number

The number of curves in the curve set.
Type:
  • Number
Source:

type :Number

The interpolation scheme applied to all curves in the curve set. Can be:
  • pc.CURVE_LINEAR
  • pc.CURVE_SMOOTHSTEP
  • pc.CURVE_CATMULL
  • pc.CURVE_CARDINAL
Type:
  • Number
Source:

Methods

clone() → {pc.CurveSet}

Returns a clone of the specified curve set object.
Source:
Returns:
A clone of the specified curve set
Type
pc.CurveSet

get(index) → {pc.Curve}

Return a specific curve in the curve set.
Parameters:
Name Type Description
index Number The index of the curve to return
Source:
Returns:
The curve at the specified index
Type
pc.Curve

(private) quantizeClamped(precision, min, max) → {Array}

This function will sample the curveset at regular intervals over the range [0..1] and clamp the result to min and max.
Parameters:
Name Type Description
precision Number The number of samples to return.
min Number The minimum output value.
max Number The maximum output value.
Source:
Returns:
The set of quantized values.
Type
Array

value(time, resultopt) → {Array}

Returns the interpolated value of all curves in the curve set at the specified time.
Parameters:
Name Type Attributes Description
time Number The time at which to calculate the value
result Array <optional>
The interpolated curve values at the specified time. If this parameter is not supplied, the function allocates a new array internally to return the result.
Source:
Returns:
The interpolated curve values at the specified time
Type
Array