Skip to content

ConditionFloatClipData

Class Documentation

Edit documentation

A clip that plays one child, chosen by the range a number falls in. The number comes from its Updater. A typical use is a Run clip that plays a walk, a run or a fast run from the character's move speed.

It runs like every condition clip, see ConditionBoolClipData: one child at a time, chosen at the start, and chosen again every frame only with mChangeAnimationMidPlay.

Unlike a ParametricClipData, it does not blend its children by the value. It plays one of them and cross-fades when it switches.

Properties

DontStompTransitionClip

Bool = false
Edit documentation

Keeps a transition clip that already plays. Same as ConditionBoolClipData.DontStompTransitionClip.

SyncFrameOnChangeAnim

Bool = false
Edit documentation

Changes the start position that a switch takes from the old child. Same as ConditionBoolClipData.SyncFrameOnChangeAnim.

Updater

Pointer<IFloatParametricUpdater> = null
Edit documentation

The source of the number: a float updater. The client reads it when the clip starts and then every frame. Later values are used only with mChangeAnimationMidPlay.

mChangeAnimationMidPlay

Bool = false
Edit documentation

Lets the clip switch to another child while it plays. Same as ConditionBoolClipData.mChangeAnimationMidPlay.

mChildAnimDelaySwitchTime

F32 = 0
Edit documentation

How long the new choice must hold before the clip switches, in seconds. Same as ConditionBoolClipData.mChildAnimDelaySwitchTime. It is counted after the hold time of the entry that is left (ConditionFloatPairData.mHoldAnimationToLower and mHoldAnimationToHigher), so the two add up.

mConditionFloatPairDataList

List<ConditionFloatPairData> = []
Edit documentation

The ranges and their children, see ConditionFloatPairData. The list must be in ascending order of mValue. The client does not sort it.

The entry is chosen like this:

  • Value of 0 or more: the last entry whose mValue is not above the value. So an entry covers the range from its mValue up to the mValue of the next entry.
  • Value below 0: the first entry whose mValue is above the value. So an entry covers the range from the mValue of the entry before it up to its own mValue.

When no entry fits the rule, the first entry is used.

Examples:
  • Move speed entries at 0, 300 and 400: a speed of 350 plays the 300 entry.
  • Angle entries at -180, -90, 0, 90 and 180: -100 plays the -90 entry, -45 and 45 both play the 0 entry, and 100 plays the 90 entry. The ranges are symmetric around zero.

mPlayAnimChangeFromBeginning

Bool = false
Edit documentation

Starts the new child at its beginning on a switch. Same as ConditionBoolClipData.mPlayAnimChangeFromBeginning.