Allows to transition from one AnimationNode to another over a specified time. If nested inside an AnimationNodeBlend, transit from/into an empty state to blend from/into the accumulated result of the container blend node.

Author

Jonas Plotzky, HFU, 2024-2025

Example:

import ƒ = FudgeCore;
// initialization
const idle: ƒ.Animation = new ƒ.Animation();
const walk: ƒ.Animation = new ƒ.Animation();
const nodeIdle: ƒ.AnimationNodeAnimation = new ƒ.AnimationNodeAnimation(idle);
const nodeWalk: ƒ.AnimationNodeAnimation = new ƒ.AnimationNodeAnimation(walk);
const nodeTransition: ƒ.AnimationNodeTransition = new ƒ.AnimationNodeTransition(nodeIdle);
const cmpAnimationGraph: ƒ.ComponentAnimationGraph = new ƒ.ComponentAnimationGraph(); // get the animation component
cmpAnimationGraph.root = nodeTransition;

// during the game
nodeTransition.transit(nodeWalk, 300); // transit to the walk animation in 300ms.
nodeTransition.transit(nodeIdle, 300); // transit back to the idle animation.

Hierarchy (view full)

Constructors

Properties

The mode used for blending this node with others in an AnimationNodeBlend. Default: ANIMATION_BLENDING.OVERRIDE.

canceled: boolean
duration: number

All nodes that can be transitioned to/from.

speed: number

The playback speed

time: number
transition: boolean
values: Map<string, Float32Array>
weight: number

The weight used for blending this node with others in an AnimationNodeBlend. Default: 1.

Methods

  • Updates the animation according the given delta time

    Parameters

    • _deltaTime: number
    • _valuesCurrent: Map<string, Float32Array>
    • _valuesOriginal: Map<string, Float32Array>
    • _dispatchEvent: ((_event) => boolean)
        • (_event): boolean
        • Parameters

          Returns boolean

    Returns void