Class AnimationNodeTransition

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.

duration: number
events: string[]

The events that occured between the nodes last two updates.

mutator: Mutator

The (blended) animation mutator at the state of the last call to update.

speed: number

The playback speed

time: number
weight: number

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

Methods