new AnimationCurve(keys) → {AnimationCurve}
Defines a continuous function through points in the unit interval
on R^2. These points are given as AnimationCurveKeys.
Parameters:
| Name | Type | Description |
|---|---|---|
keys |
Array | An optional array of Number to populate the AnimationCurve. There should be an even number of floats, each pair representing an (x, t) point. |
- Source:
Returns:
- Type
- AnimationCurve
Example
var curve = new AnimationCurve([
0, 0,
0.5, 1,
1, 0]);
Members
-
easingFunction :Function
-
Defines the easing method to use. Predefined easing types are given in the Easing object, but any function f:[0, 1] -> [0, 1] will do. Defaults to Easing.Quadradic.InOut
Type:
- Function
- Source:
Methods
-
addKey(key) → {AnimationCurveKey}
-
Adds an AnimationCurveKey to the curve.
Parameters:
Name Type Description keyAnimationCurveKey An AnimationCurveKey. - Source:
Returns:
- Type
- AnimationCurveKey
-
evaluate(t) → {Number}
-
Evaluates the animation curve at a normalized parameter t.
Parameters:
Name Type Description tNumber A value in the unit interval. - Source:
Returns:
- Type
- Number
-
getFirstKey() → {AnimationCurveKey}
-
Retrieves the first AnimationCurveKey instance.
- Source:
Returns:
- Type
- AnimationCurveKey
-
getKeys() → {Array}
-
Retrieves a copy of the keys array.
- Source:
Returns:
- Type
- Array
-
getLastKey() → {AnimationCurveKey}
-
Retrieves the last AnimationCurveKey instance.
- Source:
Returns:
- Type
- AnimationCurveKey
-
removeKey(key) → {AnimationCurveKey}
-
Removes an AnimationCurveKey from this curve.
Parameters:
Name Type Description keyAnimationCurveKey An AnimationCurveKey. - Source:
Returns:
- Type
- AnimationCurveKey