KeyframeBuffer
- class Communicator.Animation.KeyframeBuffer()
This class contains a collection of keyframes. A Keyframe consists of a scalar value T, representing the linear time in seconds, and a vector of scalars described by
KeyTypeOptionally, a Keyframe can also have a vector of tangents described byKeyTypethat are used for cubic spline interpolation. Keyframes are stored in the times, values, and tangents arrays. For example, withKeyTypeof Vec3: times: t0, t1, … tn values: v0x, v0y, v0z, … vnx, vny, vnz tangents: in_v0x, in_v0y, in_v0z, out_v0x, out_v0y, out_v0z, … in_vnx, in_vny, in_vnz, out_vnx, out_vny, out_vnz
Constructors
Methods
Constructors
Properties
- KeyframeBuffer.keyOffset
- Type
number
The number of elements between successive keyframes in the array.
- KeyframeBuffer.tangents
- Type
[number]
- KeyframeBuffer.times
- Type
[number]
- KeyframeBuffer.values
- Type
[number]
Methods
deleteKeyframe
- KeyframeBuffer.deleteKeyframe(index)
Deletes a keyframe at the specified index.
- Arguments
index (
number()) –
- Return type
void
getKeyframeIndex
- KeyframeBuffer.getKeyframeIndex(t)
Returns the index of the keyframe at the specified time.
- Arguments
t (
number()) –
- Return type
number
insertQuatKeyframe
- KeyframeBuffer.insertQuatKeyframe(t, x, y, z, w[, inTanX[, inTanY[, inTanZ[, inTanW[, outTanX[, outTanY[, outTanZ[, outTanW]]]]]]]])
Inserts a Quat keyframe with the specified time. The type of this buffer should be
KeyType.Quat- Arguments
t (
number()) –x (
number()) –y (
number()) –z (
number()) –w (
number()) –inTanX (
number()) – optionalinTanY (
number()) – optionalinTanZ (
number()) – optionalinTanW (
number()) – optionaloutTanX (
number()) – optionaloutTanY (
number()) – optionaloutTanZ (
number()) – optionaloutTanW (
number()) – optional
- Return type
void
- Returns
Index at which keyframe was inserted
insertScalarKeyframe
- KeyframeBuffer.insertScalarKeyframe(t, val[, inTan[, outTan]])
Inserts a Scalar keyframe with the specified time. The type of this buffer should be
KeyType.Scalar- Arguments
t (
number()) –val (
number()) –inTan (
number()) – optionaloutTan (
number()) – optional
- Return type
number
- Returns
Index at which keyframe was inserted
insertVec3Keyframe
- KeyframeBuffer.insertVec3Keyframe(t, x, y, z[, inTanX[, inTanY[, inTanZ[, outTanX[, outTanY[, outTanZ]]]]]])
Inserts a Vec3 keyframe with the specified time. The type of this buffer should be [[KeyType.Vec3]]
- Arguments
t (
number()) –x (
number()) –y (
number()) –z (
number()) –inTanX (
number()) – optionalinTanY (
number()) – optionalinTanZ (
number()) – optionaloutTanX (
number()) – optionaloutTanY (
number()) – optionaloutTanZ (
number()) – optional
- Return type
number
- Returns
Index at which keyframe was inserted
updateQuatKeyframe
- KeyframeBuffer.updateQuatKeyframe(index, t, x, y, z, w[, inTanX[, inTanY[, inTanZ[, inTanW[, outTanX[, outTanY[, outTanZ[, outTanW]]]]]]]])
Updates a Quat keyframe at the specified index. The type of this buffer should be
KeyType.Quat- Arguments
index (
number()) –t (
number()) –x (
number()) –y (
number()) –z (
number()) –w (
number()) –inTanX (
number()) – optionalinTanY (
number()) – optionalinTanZ (
number()) – optionalinTanW (
number()) – optionaloutTanX (
number()) – optionaloutTanY (
number()) – optionaloutTanZ (
number()) – optionaloutTanW (
number()) – optional
- Return type
void
updateScalarKeyframe
- KeyframeBuffer.updateScalarKeyframe(index, t, val[, inTan[, outTan]])
Updates a Scalar keyframe at the specified index. The type of this buffer should be
KeyType.Scalar- Arguments
index (
number()) –t (
number()) –val (
number()) –inTan (
number()) – optionaloutTan (
number()) – optional
- Return type
void
updateVec3Keyframe
- KeyframeBuffer.updateVec3Keyframe(index, t, x, y, z[, inTanX[, inTanY[, inTanZ[, outTanX[, outTanY[, outTanZ]]]]]])
Updates a Vec3 keyframe at the specified index. The type of this buffer should be [[KeyType.Vec3]]
- Arguments
index (
number()) –t (
number()) –x (
number()) –y (
number()) –z (
number()) –inTanX (
number()) – optionalinTanY (
number()) – optionalinTanZ (
number()) – optionaloutTanX (
number()) – optionaloutTanY (
number()) – optionaloutTanZ (
number()) – optional
- Return type
number