RotationCurve

Show Deprecated

This class holds a sorted list of RotationCurveKey|RotationCurveKeys that represent a sequence of rotations. The shape of the interpolation curve between two RotationCurveKeys is determined by the RotationCurveKey interpolation type. RotationCurve provides a sampling method GetValueAtTime returning its result as the rotation component of a CFrame.

Summary

Properties

  • read only
    not replicated
    read parallel

    Number of rotation keys in this curve.

Methods

  • GetKeyAtIndex(index: number):RotationCurveKey

    Returns a copy of a key at a given index.

  • Returns the index of the last and first key of a period of time.

  • Returns a copy of all the keys in the RotationCurve as a Lua array of RotationCurveKey.

  • Samples the RotationCurve at a given time and returns the corresponding rotation as a CFrame. Empty RotationCurves are evaluated as identity.

  • InsertKey(key: RotationCurveKey):Array

    Adds the key passed as argument to this curve. If a key at the same time is found it will be replaced.

  • RemoveKeyAtIndex(startingIndex: number,count: number):number

    Removes a given number of Keys starting from a given index. Returns the number of keys that were removed.

  • Resets this curve keys using the RotationCurveKey array passed as argument.

Properties

Length

read only
not replicated
read parallel

Number of rotation keys in this curve.

Methods

GetKeyAtIndex

RotationCurveKey

Returns a copy of a key at a given index.

Parameters

index: number

Returns

RotationCurveKey

GetKeyIndicesAtTime

The first returned value is the index of the last key with key.time <= time (or min(1,length) if no key was found). The second returned value is the index of the first key with key.time >= time (or the length of the curve if no key was found satisfying the inequality).

Parameters

time: number

Returns

GetKeys

Returns a copy of all the keys in the RotationCurve as a Lua array of RotationCurveKey.


Returns

GetValueAtTime

Samples the RotationCurve at a given time and returns the corresponding rotation as a CFrame. Empty RotationCurves are evaluated as identity.

Parameters

time: number

Returns

InsertKey

Adds the key passed as argument to this curve. If a key at the same time is found it will be replaced. First return value is true if a key was added, false if a previous key was replaced. Second return value is the index at which the marker was added.

Parameters

key: RotationCurveKey

Returns

RemoveKeyAtIndex

Removes a given number of Keys starting from a given index. Returns the number of keys that were removed.

Parameters

startingIndex: number
count: number
Default Value: 1

Returns

SetKeys

Resets this curve keys using the RotationCurveKey array passed as argument. Keys in the keysArray are sorted in ascending time order before insertion. Keys at duplicated times are removed in a stable manner. Returns the number of keys actually inserted. Keys previously stored in this curve are removed before the keys passed as arguments are added.

Parameters

keys: Array

Returns

Events