Skip to content

BlendingSwitchMaterialDriver

Inheritance 2 ancestors

Class Documentation

Edit documentation

A SwitchMaterialDriver that fades to the new value when the choice changes, instead of jumping to it. The choice is made as in the plain switch: the first element of mElements whose condition is true, or mDefaultValue when no condition is true.

The driver keeps one blend per source. When the choice changes, the blend weight restarts at 0, and the result fades from the value before the change to the value of the new choice. On each evaluation the weight grows by the time of the last frame divided by the blend time, so a full fade takes the blend time in seconds. The blend of a source is removed when the source is destroyed.

Properties

mBlendTime

F32 = 1
Edit documentation

The fade time, in seconds, for a change to an element that has no entry in mOverrideBlendTimes.

mOverrideBlendTimes

List<F32> = []
Edit documentation

Fade times, in seconds, by element index. Entry i is the fade time for a change to element i of mElements. An element past the end of this list uses mBlendTime.