AnimationCurve
Classes
- AnimationCurve
Modelled on unity's AnimationCurve
Functions
AnimationCurve
Modelled on unity's AnimationCurve
Kind: global class
See: https://github.com/nothke/ThreadableCurve/blob/master/ThreadableCurve.cs
- AnimationCurve
- instance
- .keys :
Array.<Keyframe>
- .length ⇒
number
- .start_time ⇒
number
- .end_time ⇒
number
- .duration ⇒
number
- .add(key) ⇒
number
- .addMany(keys)
- .remove(key) ⇒
boolean
- .clear()
- .evaluate(time) ⇒
number
- .alignTangents(index)
- .smoothTangents(index, weight)
- .equals(other) ⇒
boolean
- .copy(other)
- .clone() ⇒
AnimationCurve
- .hash() ⇒
number
- .keys :
- static
- instance
animationCurve.keys : Array.<Keyframe>
Kind: instance property of AnimationCurve
Read only: true
animationCurve.length ⇒ number
Number of keys
Kind: instance property of AnimationCurve
animationCurve.start_time ⇒ number
Time of the first keyframe, returns 0 if there are no keys
Kind: instance property of AnimationCurve
animationCurve.end_time ⇒ number
Time of the last chronological key in the curve
Kind: instance property of AnimationCurve
animationCurve.duration ⇒ number
Time difference between first and last frame
Kind: instance property of AnimationCurve
animationCurve.add(key) ⇒ number
Kind: instance method of AnimationCurve
Returns: number
- key index where it was inserted at
Param | Type |
---|---|
key | Keyframe |
animationCurve.addMany(keys)
Kind: instance method of AnimationCurve
Param | Type |
---|---|
keys | Array.<Keyframe> |
animationCurve.remove(key) ⇒ boolean
Kind: instance method of AnimationCurve
Param | Type |
---|---|
key | Keyframe |
animationCurve.clear()
Remove all keys
Kind: instance method of AnimationCurve
animationCurve.evaluate(time) ⇒ number
Kind: instance method of AnimationCurve
Param | Type | Description |
---|---|---|
time | number | time in seconds |
animationCurve.alignTangents(index)
Set tangents of a key to match surrounding keys Produces a smoother looking curve
Kind: instance method of AnimationCurve
Param | Type | Description |
---|---|---|
index | number | index of keyframe |
animationCurve.smoothTangents(index, weight)
Kind: instance method of AnimationCurve
Param | Type | Description |
---|---|---|
index | number | Index of keyframe to be affected |
weight | number | How much smoothing to apply, 1 will be fully smoothed out and 0 will have no effect at all. Value between 0 and 1 |
animationCurve.equals(other) ⇒ boolean
Kind: instance method of AnimationCurve
Param | Type |
---|---|
other | AnimationCurve |
animationCurve.copy(other)
The copy is deep
Kind: instance method of AnimationCurve
Param | Type |
---|---|
other | AnimationCurve |
animationCurve.clone() ⇒ AnimationCurve
Kind: instance method of AnimationCurve
animationCurve.hash() ⇒ number
Kind: instance method of AnimationCurve
AnimationCurve.from(keys) ⇒ AnimationCurve
Kind: static method of AnimationCurve
Param | Type |
---|---|
keys | Array.<Keyframe> |
AnimationCurve.easeInOut([timeStart], [valueStart], [timeEnd], [valueEnd]) ⇒ AnimationCurve
Kind: static method of AnimationCurve
Param | Type | Default |
---|---|---|
[timeStart] | number | 0 |
[valueStart] | number | 0 |
[timeEnd] | number | 1 |
[valueEnd] | number | 1 |
AnimationCurve.constant([timeStart], [timeEnd], [value]) ⇒ AnimationCurve
Kind: static method of AnimationCurve
Param | Type | Default |
---|---|---|
[timeStart] | number | 0 |
[timeEnd] | number | 1 |
[value] | number | 0 |
AnimationCurve.linear([timeStart], [valueStart], [timeEnd], [valueEnd]) ⇒ AnimationCurve
Kind: static method of AnimationCurve
Param | Type | Default |
---|---|---|
[timeStart] | number | 0 |
[valueStart] | number | 0 |
[timeEnd] | number | 1 |
[valueEnd] | number | 1 |
compareKeyframeToTime(time, keyframe) ⇒ number
Kind: global function
Param | Type |
---|---|
time | number |
keyframe | Keyframe |