Skip to content

VfxProbabilityTableData

Value struct

Class Documentation

Edit documentation

A probability table: a random factor for one channel of a VfxAnimated*VariableData curve. Each time the curve is evaluated, the table turns a random number u in 0..1 into a factor, and the curve multiplies that channel of its result by the factor. A table never replaces or adds to the value. The VfxAnimated* curves do not read their tables.

Sampling

The factor is:

  1. singleValue, if keyTimes is empty.
  2. keyValues[0] + u * (keyValues[1] - keyValues[0]), if keyTimes is [0, 1]. This is a uniform draw between the two values.
  3. 0, if keyValues does not have as many entries as keyTimes.
  4. Otherwise a lookup of u along keyTimes: keyValues[0] at or before the first key, a straight line between the two keys around u, and the last value after the last key.

keyTimes are positions of the random number, so the table is an inverse cumulative distribution: the share of 0..1 between two keys is the probability that the factor falls between their values.

Random number

The holder supplies u. If the holder supplies none, each channel draws a new number at each evaluation. The draw table under Animated values on VfxEmitterDefinitionData lists when each emitter property draws. A driver reads u from its random slots, see Random values on IVfxBaseDriver.

Properties

keyTimes

List<F32> = []
Edit documentation

Positions in the random range 0..1, ascending. If it is empty, the factor is singleValue.

keyValues

List<F32> = []
Edit documentation

The factor at each entry of keyTimes. It needs as many entries as keyTimes, otherwise the factor is 0.

Referenced by 10 classes · 10 properties