API Reference

Class List

pc.CurveSet

A curve set is a collection of curves.

Summary

Properties

lengthThe number of curves in the curve set.[read only]
typeThe interpolation scheme applied to all curves in the curve set.

Methods

cloneReturns a clone of the specified curve set object.
getReturn a specific curve in the curve set.
valueReturns the interpolated value of all curves in the curve set at the specified time.

Details

Constructor

CurveSet([curveKeys])

Creates a new curve set.

Parameters

curveKeysArrayAn array of arrays of keys (pairs of numbers with the time first and value second).

Properties

Numberlength

The number of curves in the curve set.[read only]

Numbertype

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

Methods

clone()

Returns a clone of the specified curve set object.

Returns

pc.CurveSet A clone of the specified curve set

get(index)

Return a specific curve in the curve set.

Parameters

indexNumberThe index of the curve to return

Returns

pc.Curve The curve at the specified index

value(time, [result])

Returns the interpolated value of all curves in the curve set at the specified time.

Parameters

timeNumberThe time at which to calculate the value
resultArrayThe interpolated curve values at the specified time. If this parameter is not supplied, the function allocates a new array internally to return the result.

Returns

Array The interpolated curve values at the specified time