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 KeyType Optionally, a Keyframe can also have a vector of tangents described by KeyType that are used for cubic spline interpolation. Keyframes are stored in the times, values, and tangents arrays. For example, with KeyType of 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

constructor()

Creates a new buffer for storing keyframe data.

Properties

keyOffset

The number of elements between successive keyframes in…

keyType

tangents

times

values

Methods

deleteKeyframe()

getKeyframeIndex()

insertQuatKeyframe()

insertScalarKeyframe()

insertVec3Keyframe()

updateQuatKeyframe()

updateScalarKeyframe()

updateVec3Keyframe()


Constructors

constructor

Communicator.Animation.KeyframeBuffer.constructor(keyType)

Creates a new buffer for storing keyframe data.

Arguments
  • keyType (Communicator.Animation.KeyType()) –

Return type

Communicator.Animation.KeyframeBuffer

Properties

Communicator.Animation.KeyframeBuffer.keyOffset

The number of elements between successive keyframes in the array.

Communicator.Animation.KeyframeBuffer.keyType
Communicator.Animation.KeyframeBuffer.tangents
Communicator.Animation.KeyframeBuffer.times
Communicator.Animation.KeyframeBuffer.values

Methods

deleteKeyframe

Communicator.Animation.KeyframeBuffer.deleteKeyframe(index)

Deletes a keyframe at the specified index.

Arguments
  • index (number()) –

Return type

void

getKeyframeIndex

Communicator.Animation.KeyframeBuffer.getKeyframeIndex(t)

Returns the index of the keyframe at the specified time.

Arguments
  • t (number()) –

Return type

number

insertQuatKeyframe

Communicator.Animation.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 ({  }()) –

  • inTanY ({  }()) –

  • inTanZ ({  }()) –

  • inTanW ({  }()) –

  • outTanX ({  }()) –

  • outTanY ({  }()) –

  • outTanZ ({  }()) –

  • outTanW ({  }()) –

Return type

void

Returns

Index at which keyframe was inserted

insertScalarKeyframe

Communicator.Animation.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 ({  }()) –

  • outTan ({  }()) –

Return type

number

Returns

Index at which keyframe was inserted

insertVec3Keyframe

Communicator.Animation.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 ({  }()) –

  • inTanY ({  }()) –

  • inTanZ ({  }()) –

  • outTanX ({  }()) –

  • outTanY ({  }()) –

  • outTanZ ({  }()) –

Return type

number

Returns

Index at which keyframe was inserted

updateQuatKeyframe

Communicator.Animation.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 ({  }()) –

  • inTanY ({  }()) –

  • inTanZ ({  }()) –

  • inTanW ({  }()) –

  • outTanX ({  }()) –

  • outTanY ({  }()) –

  • outTanZ ({  }()) –

  • outTanW ({  }()) –

Return type

void

updateScalarKeyframe

Communicator.Animation.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 ({  }()) –

  • outTan ({  }()) –

Return type

void

updateVec3Keyframe

Communicator.Animation.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 ({  }()) –

  • inTanY ({  }()) –

  • inTanZ ({  }()) –

  • outTanX ({  }()) –

  • outTanY ({  }()) –

  • outTanZ ({  }()) –

Return type

number