Skip to content

VfxAnimatedFloat

13.16

Inheritance 1 ancestor · 1 sibling

Class Documentation

Edit documentation

A keyframe curve with an interpolation mode per span. The holder multiplies the sampled value by its constantValue, see ValueFloat. This page describes sampling for all VfxAnimated* curves (VfxAnimatedVector2f, VfxAnimatedVector3f, VfxAnimatedColor).

Sampling

At a time t the curve returns:

  1. The only entry of values, if values has exactly one entry. times is not read.
  2. The first entry of values, if t is at or before the first key.
  3. Otherwise, for the span from times[i] to times[i+1] that contains t, the interpolation that InterpModes[i] selects, with s = (t - times[i]) / (times[i+1] - times[i]).
  4. The last entry of values, if t is after the last key.

So the curve holds its first value before the first key and its last value after the last key. It does not clamp or wrap t itself.

Interpolation modes

Each entry of InterpModes selects the mode of one span. If InterpModes is empty, every span is linear.

Value Mode Entries of values per key Result in the span
0 Linear 1 Straight line from the key's value to the next key's value.
1 Step 1 The key's value, held until the next key.
2 Bezier 3: value, out-tangent, in-tangent Cubic curve from the key's value to the next key's value. The out-tangent is the slope at the start of the span, and the in-tangent that follows it is the slope at the end of the span, both in value units per unit of t.
3 and above Invalid 0 The span is skipped. Later spans read the wrong entries of values.

A Bezier span uses three entries for its start key, so values holds one entry per key plus two per Bezier span, and it is longer than times when the curve has Bezier spans. Shipped curves use only modes 0 and 2.

Properties

InterpModes

List2<U8> = []
14.8
Type history (2 revisions)
  • 14.8 - 16.6 List<U32>
  • since 16.7 List2<U8>
Edit documentation

The interpolation mode of each span between two keys, one entry per span. The values are listed in Interpolation modes above.

modes

List2<U8> = []
Removed in 14.8
Add documentation

No documentation available yet. Click "Add documentation" to contribute!

times

List2<F32> = []
Type history (3 revisions)
  • 13.16 - 14.7 List2<F32>
  • 14.8 - 16.6 List<F32>
  • since 16.7 List2<F32>
Edit documentation

The positions of the keys on the holder's clock, ascending.

values

List2<F32> = []
Type history (3 revisions)
  • 13.16 - 14.7 List2<F32>
  • 14.8 - 16.6 List<F32>
  • since 16.7 List2<F32>
Edit documentation

The value at each key, with two tangent entries after each key that starts a Bezier span. See Interpolation modes above.