Press Ctrl+F1 to toggle this dialog
Animation
Test
Animations manipulate properties of a mutable object according to a given input, mostly time, along cubic splines.
The properties to manipulate are given as AnimationStructure and can be nested, the input and output values as a AnimationSequence of AnimationKeys.
They are combined as Animation and can be controlled by a ComponentAnimator to manipulate the other components of its container.
Additionally, event-triggers may be installed with an animation to fire events when the input value passes the trigger input.
To help navigating within an animation, labels may be defined.
Setup
A cube with a transform- and an animator-component. An AnimationStructure references the x and y axis of the rotation of the transform
A minimal sequence of two AnimationsKeys with adjustable input and output values, where input refers to time as is standard
An Animation using the sequence and structure, with one event-trigger and a label, plus a framerate for discrete animation
Act
adjust point of time and value of the animation keys.
adjust fps, the input-value of the event trigger and the time the label references.
select the animation mode and the type of quantization
click the button to jump to the label
Observe
The cube moves according to the given values, which are the only variables. The gameloop runs constantly in request-mode.
See the console to check if the events are fired when the trigger was passed during the last frame
Expect
playmodes
- LOOP it restarts once it hit the end
- PLAYONCE plays animation once and stops at the last key/frame
- PLAYONCESTOPAFTER plays animation once and stops on the first key/frame
- REVERSELOOP plays animation like LOOP, but backwards
- STOP causes the animation not to play at all
quantization
- CONTINOUS a loop of the animation lasts as long as the specified value of the second key
- RASTERED_TO_FPS the animation depends on the specified fps, the animation is updated per frame
- FRAMES Advances the time each frame according to the FPS value of the animation, ignoring the actual duration of the frames. Doesn't skip any frames
Sequence
Key 0: time
value
Key 1: time
value
Animation
fps (the number of frames defined per second for animations with discrete steps, e.g. sprite images)
time for an event to fire
time at which the label is placed
Jump
The animation structure is hardcoded in this test and maps the sequence onto the x- and y-rotation of the cubes transform component
ComponentAnimator
LOOP
PLAY_ONCE
PLAY_ONCE_RESET
REVERSE_LOOP
STOP
playmode
CONTINOUS
DISCRETE
FRAMES
quantization