Skip to content

LerpMaterialDriver

Inheritance 2 ancestors · 48 siblings

Class Documentation

Edit documentation

A float driver that fades between two values when a bool driver changes. While mBoolDriver is true the value moves toward mOnValue, and while it is false toward mOffValue.

The driver keeps one current value per source, so each unit or prop that shares the driver fades on its own. The value of a source is removed when the source is destroyed.

On every evaluation:

  1. The first evaluation for a source returns the target value at once. There is no fade from a start value.
  2. When the current value is not at the target, it moves toward it by the time of the last frame. A full swing from one value to the other takes mTurnOnTimeSec or mTurnOffTimeSec seconds.
  3. The value never leaves the range between mOffValue and mOnValue.

The step uses the game clock, so a paused game freezes the fade.

Properties

mBoolDriver

Pointer<ILogicBoolDriver> = null
Edit documentation

The condition that picks the target value. It must be set: the client does not check for a missing operand.

mTurnOffTimeSec

F32 = 1
Edit documentation

The time, in seconds, of a full fade from mOnValue to mOffValue. 0 switches at once.

mTurnOnTimeSec

F32 = 1
Edit documentation

The time, in seconds, of a full fade from mOffValue to mOnValue. 0 switches at once.

mUseBrokenOldInterpolation

Bool = false
Edit documentation

Selects the older fade speed. When true, the value moves by 1 per fade time, whatever the distance between mOnValue and mOffValue. The fade then takes the configured time only when the two values are exactly 1 apart: a swing of 0.5 takes half the time, and a swing of 10 takes ten times as long.