KeyFrame

KeyFrame class

A key frame is mainly defined by a time and a value, for some interpolation types, tangent/tension/bias/continuity is also used by calculating the final sampled value. Sampled values in a non-key-frame time position is interpolated by key-frames between the previous and next key-frames Value before/after the first/last key-frame are calculated by the Extrapolation class.

Methods

constructor

NameDescription
constructor(curve, time)Create a new key frame on specified curve

Parameters:

NameTypeDescription
curveKeyframeSequenceThe curve that the key frame will be created on
timeNumberThe time position of the key frame

Result:


getTime

NameDescription
getTime()Gets or sets the time position of list.data[index] key frame, measured in seconds. The time.

Result:


setTime

NameDescription
setTime(value)Gets or sets the time position of list.data[index] key frame, measured in seconds. The time.

Result:


getValue

NameDescription
getValue()Gets or sets the key-frame’s value. The value.

Result:


setValue

NameDescription
setValue(value)Gets or sets the key-frame’s value. The value.

Result:


getInterpolation

NameDescription
getInterpolation()Gets or sets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated. The value of the property is Interpolation integer constant.The interpolation.

Result:


setInterpolation

NameDescription
setInterpolation(value)Gets or sets the key’s interpolation type, list.data[index] defines the algorithm how the sampled value is calculated. The value of the property is Interpolation integer constant.The interpolation.

Result:


getTangentWeightMode

NameDescription
getTangentWeightMode()Gets or sets the key’s tangent weight mode. The out tangent or the next in tangent can be customized by select correct WeightedModeThe value of the property is WeightedMode integer constant.The tangent weight mode.

Result:


setTangentWeightMode

NameDescription
setTangentWeightMode(value)Gets or sets the key’s tangent weight mode. The out tangent or the next in tangent can be customized by select correct WeightedModeThe value of the property is WeightedMode integer constant.The tangent weight mode.

Result:


getStepMode

NameDescription
getStepMode()Gets or sets the key’s step mode. If the interpolation type is Interpolation.CONSTANT, list.data[index] decides which key-frame’s value will be used during interpolation. A StepMode.PREVIOUS_VALUE means the left key-frame’s value will be used A StepMode.NEXT_VALUE means the next right key-frame’s value will be used The value of the property is StepMode integer constant.The step mode.

Result:


setStepMode

NameDescription
setStepMode(value)Gets or sets the key’s step mode. If the interpolation type is Interpolation.CONSTANT, list.data[index] decides which key-frame’s value will be used during interpolation. A StepMode.PREVIOUS_VALUE means the left key-frame’s value will be used A StepMode.NEXT_VALUE means the next right key-frame’s value will be used The value of the property is StepMode integer constant.The step mode.

Result:


getNextInTangent

NameDescription
getNextInTangent()Gets or sets the next in(left) tangent on this key frame.

Result:


setNextInTangent

NameDescription
setNextInTangent(value)Gets or sets the next in(left) tangent on this key frame.

Result:


getOutTangent

NameDescription
getOutTangent()Gets or sets the out(right) tangent on this key frame.

Result:


setOutTangent

NameDescription
setOutTangent(value)Gets or sets the out(right) tangent on this key frame.

Result:


getOutWeight

NameDescription
getOutWeight()Gets or sets the out(right) weight on this key frame.

Result:


setOutWeight

NameDescription
setOutWeight(value)Gets or sets the out(right) weight on this key frame.

Result:


getNextInWeight

NameDescription
getNextInWeight()Gets or sets the next in(left) weight on this key frame.

Result:


setNextInWeight

NameDescription
setNextInWeight(value)Gets or sets the next in(left) weight on this key frame.

Result:


getTension

NameDescription
getTension()Gets or sets tension used in TCB spline

Result:


setTension

NameDescription
setTension(value)Gets or sets tension used in TCB spline

Result:


getContinuity

NameDescription
getContinuity()Gets or sets the continuity used in TCB spline

Result:


setContinuity

NameDescription
setContinuity(value)Gets or sets the continuity used in TCB spline

Result:


getBias

NameDescription
getBias()Gets or sets the bias used in TCB spline

Result:


setBias

NameDescription
setBias(value)Gets or sets the bias used in TCB spline

Result:


getIndependentTangent

NameDescription
getIndependentTangent()Gets or sets the out and next in tangents are independent.

Result:


setIndependentTangent

NameDescription
setIndependentTangent(value)Gets or sets the out and next in tangents are independent.

Result:


getFlat

NameDescription
getFlat()Get or set if the key frame is flat. Key frame should be flat if next or previous key frame has the same value. Flat key frame has flat tangents and fixed interpolation.

Result:


setFlat

NameDescription
setFlat(value)Get or set if the key frame is flat. Key frame should be flat if next or previous key frame has the same value. Flat key frame has flat tangents and fixed interpolation.

Result:


getTimeIndependentTangent

NameDescription
getTimeIndependentTangent()Gets or sets the tangent is time-independent

Result:


setTimeIndependentTangent

NameDescription
setTimeIndependentTangent(value)Gets or sets the tangent is time-independent

Result:


toString

NameDescription
toString()Gets the string representation of the key frame

Result: String