Skip to main content

AnimationCurve

Classes

AnimationCurve

Modelled on unity's AnimationCurve

Functions

compareKeyframeToTime(time, keyframe)number

AnimationCurve

Modelled on unity's AnimationCurve

Kind: global class
See: https://github.com/nothke/ThreadableCurve/blob/master/ThreadableCurve.cs

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

ParamType
keyKeyframe

animationCurve.addMany(keys)

Kind: instance method of AnimationCurve

ParamType
keysArray.<Keyframe>

animationCurve.remove(key) ⇒ boolean

Kind: instance method of AnimationCurve

ParamType
keyKeyframe

animationCurve.clear()

Remove all keys

Kind: instance method of AnimationCurve

animationCurve.evaluate(time) ⇒ number

Kind: instance method of AnimationCurve

ParamTypeDescription
timenumbertime in seconds

animationCurve.alignTangents(index)

Set tangents of a key to match surrounding keys Produces a smoother looking curve

Kind: instance method of AnimationCurve

ParamTypeDescription
indexnumberindex of keyframe

animationCurve.smoothTangents(index, weight)

Kind: instance method of AnimationCurve

ParamTypeDescription
indexnumberIndex of keyframe to be affected
weightnumberHow 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

ParamType
otherAnimationCurve

animationCurve.copy(other)

The copy is deep

Kind: instance method of AnimationCurve

ParamType
otherAnimationCurve

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

ParamType
keysArray.<Keyframe>

AnimationCurve.easeInOut([timeStart], [valueStart], [timeEnd], [valueEnd]) ⇒ AnimationCurve

Kind: static method of AnimationCurve

ParamTypeDefault
[timeStart]number0
[valueStart]number0
[timeEnd]number1
[valueEnd]number1

AnimationCurve.constant([timeStart], [timeEnd], [value]) ⇒ AnimationCurve

Kind: static method of AnimationCurve

ParamTypeDefault
[timeStart]number0
[timeEnd]number1
[value]number0

AnimationCurve.linear([timeStart], [valueStart], [timeEnd], [valueEnd]) ⇒ AnimationCurve

Kind: static method of AnimationCurve

ParamTypeDefault
[timeStart]number0
[valueStart]number0
[timeEnd]number1
[valueEnd]number1

compareKeyframeToTime(time, keyframe) ⇒ number

Kind: global function

ParamType
timenumber
keyframeKeyframe