RotationCurve
Represents a sequence of rotations and the interpolation curve between them.
Memory category | Instances |
---|
Member index 9
Description
This class holds a sorted list of RotationCurveKeys that represent a sequence of rotations. The shape of the interpolation curve between two keys is determined by the RotationCurveKey.Interpolation type.
History 12
- 596 Change Default of from to
- 553 Add
- 553 Change Default of Length from to 0
- 497 Add SetKeys
- 497 Add RemoveKeyAtIndex
- 497 Add InsertKey
- 497 Add GetValueAtTime
- 497 Add GetKeys
- 497 Add GetKeyIndicesAtTime
- 497 Add GetKeyAtIndex
- 497 Add Length
- 497 Add RotationCurve
Members 9
GetKeyAtIndex
Parameters (1) | ||
---|---|---|
index | int | |
Returns (1) | ||
RotationCurveKey |
Returns a copy of a key at a given index.
Thread safety | Unsafe |
---|
History 1
- 497 Add GetKeyAtIndex
GetKeyIndicesAtTime
Parameters (1) | ||
---|---|---|
time | float | |
Returns (1) | ||
Array |
The first item in the returned array is the index of the last key with
time less than or equal to time
(or the lesser of either 1 or the curve
length if no key was found). The second item in the returned array is the
index of the first key with time greater than or equal to time
(or the
curve length if no key was found satisfying the inequality).
Thread safety | Unsafe |
---|
History 1
GetKeys
Parameters (0) | ||
---|---|---|
No parameters. | ||
Returns (1) | ||
Array |
Returns a copy of all the keys in the rotation curve as a Lua array of RotationCurveKeys.
Thread safety | Unsafe |
---|
GetValueAtTime
Parameters (1) | ||
---|---|---|
time | float | |
Returns (1) | ||
CoordinateFrame? |
Samples the rotation curve at a given time and returns the corresponding rotation as a CFrame. Empty rotation curves are evaluated as CFrame.identity.
Thread safety | Unsafe |
---|
History 1
- 497 Add GetValueAtTime
InsertKey
Parameters (1) | ||
---|---|---|
key | RotationCurveKey | |
Returns (1) | ||
Array |
Adds the key passed as an argument to this curve. If a key at the same
time is found, it will be replaced. In the returned array, the first value
is true
if a key was added or false
if a previous key was replaced;
the second value is the index at which the marker was added.
Thread safety | Unsafe |
---|
Length
Type | Default | |
---|---|---|
int | 0 |
Number of rotation keys in this curve.
Thread safety | ReadSafe |
---|---|
Category | Data |
Loaded/Saved | false/true |
RemoveKeyAtIndex
Parameters (2) | Default | |
---|---|---|
startingIndex | int | |
count | int | 1 |
Returns (1) | ||
int |
Removes a given number (count
) of keys starting from the startingIndex
index and returns the number of keys that were removed.
Thread safety | Unsafe |
---|
History 1
- 497 Add RemoveKeyAtIndex
SetKeys
Parameters (1) | ||
---|---|---|
keys | Array | |
Returns (1) | ||
int |
Resets this curve's keys using the RotationCurveKey array
passed as an argument. Keys in the keys
array are sorted in ascending
time order before insertion, and 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.
Thread safety | Unsafe |
---|