FloatCurveKey¶
A time-value pair used with FloatCurve instances.
Not implemented in Nova
This datatype is not registered in Nova's Lua VM. Constructing or receiving it from an API call will not work.
Description¶
A time-value pair used with FloatCurve instances.
The Interpolation property dictates the interpolation mode for the segment started by this key and ended by the next key on the curve. Each segment may use a different interpolation mode.
The LeftTangent and RightTangent properties apply to the cubic interpolation mode and define the desired tangent (slope) at the key. Different left and right values can be used to encode discontinuities in slope at the key. Attempting to set a RightTangent value on a key that doesn't use the cubic interpolation mode will result in a runtime error. It is possible to set the LeftTangent property on any key, as it will be used should the preceding segment use cubic interpolation.
Constructors¶
new Not yet Returns a new FloatCurveKey from the given time and value.
Returns a new FloatCurveKey from the given time and value.
Creates a new FloatCurveKey at a given time and value. LeftTangent and RightTangent are left uninitialized and, if not initialized, tangent values of 0 will be used when evaluating the curve.
Properties¶
Interpolation Not yet The key interpolation mode for the segment started by this FloatCurveKey.
The key interpolation mode for the segment started by this FloatCurveKey.
Specifies the interpolation mode used for the curve segment that begins at this key and ends at the next key on the FloatCurve. Each segment of the curve can use a different interpolation mode. The default value is KeyInterpolationMode.Cubic.
The available modes are:
- Constant — the segment holds the value of this key until the next key.
- Linear — the segment linearly interpolates between this key's value and the next key's value.
- Cubic — the segment uses a cubic Hermite spline defined by this key's RightTangent and the next key's LeftTangent.
Changing this property to a non-cubic mode automatically clears the RightTangent of this key, because only cubic segments use a right tangent.
Time Not yet The time position of this FloatCurveKey.
The time position of this FloatCurveKey.
The time position of this FloatCurveKey along the curve's
timeline. The default value is 0. Keys within a FloatCurve are
kept sorted in ascending time order; if you insert a key at a time that
already exists on the curve, the existing key at that time is replaced.
Value Not yet The value of this FloatCurveKey.
The value of this FloatCurveKey.
The numerical output value at this key's position on the curve. The
default value is 0. When a FloatCurve is sampled at this key's
Time, the curve evaluates to this value
(subject to any interpolation with neighboring keys depending on the
sampling time).
RightTangent Not yet The tangent to the right of this FloatCurveKey.
The tangent to the right of this FloatCurveKey.
The slope of the curve leaving this key toward the next key. The default
value is nil, which means the tangent is automatically computed (an
effective value of 0 is used during evaluation). This property can only
be set when Interpolation is
KeyInterpolationMode.Cubic; attempting to set it on a key with
Constant or Linear interpolation raises a runtime error. Pairing a
different RightTangent value on this key with a different
LeftTangent value on the next key
creates a discontinuity in slope (a "corner") at the next key.
LeftTangent Not yet The tangent to the left of this FloatCurveKey.
The tangent to the left of this FloatCurveKey.
The slope of the curve arriving at this key from the previous key. The
default value is nil, which means the tangent is automatically computed
(an effective value of 0 is used during evaluation). Unlike
RightTangent, this property can be
set on a key with any interpolation mode, because the preceding segment
may itself use cubic interpolation and therefore needs a defined left
tangent at this endpoint.
Roblox reference: FloatCurveKey