FloatCurve
An instance representing a 1D float curve encoded via a sorted list of FloatCurveKeys. The shape of the interpolation curve between two keys is determined by the FloatCurveKey.Interpolation type.
Podsumowanie
Właściwości
Number of keys in the float curve.
Metody
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 FloatCurve as a Luau array of FloatCurveKeys.
Samples the float curve at a given time passed as argument.
Adds the key passed as an argument to this curve. If a key at the same time is found, it will be replaced.
Removes a given number of keys starting from a given index.
Resets this curve's keys using the FloatCurveKey array passed as an argument.
Właściwości
Metody
GetKeyAtIndex
Returns a copy of a key at a given index.
Parametry
Zwroty
GetKeyIndicesAtTime
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).
Parametry
Zwroty
GetKeys
Returns a copy of all the keys in the FloatCurve as a Luau array of FloatCurveKeys.
Zwroty
Array of FloatCurveKeys.
GetValueAtTime
Samples the float curve at a given time passed as argument.
Parametry
Time at which to sample the curve.
Zwroty
Value of the curve at the requested time.
InsertKey
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.
Parametry
FloatCurveKey to insert.
Zwroty
(see description) .
RemoveKeyAtIndex
Removes a given number (count) of keys starting from the startingIndex index and returns the number of keys that were removed.
Parametry
Starting index from which to remove keys.
Number of keys to remove.
Zwroty
Number of keys removed.
SetKeys
Resets this curve's keys using the FloatCurveKey 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.
Parametry
Array of FloatCurveKeys.
Zwroty
Number of keys inserted.