vkmEngine 1.0.0
A C++ game engine · vkmengine.com
Loading...
Searching...
No Matches
Vkm::Engine::AnimationSystem Class Reference

Advances every Animation component and writes its result into the entity's local Transform. More...

#include <animation_system.h>

Inheritance diagram for Vkm::Engine::AnimationSystem:
Vkm::Engine::System

Public Member Functions

void fixedUpdate (FrameContext &ctx) override
 Execute this system at the fixed simulation rate.
Public Member Functions inherited from Vkm::Engine::System
virtual bool isReplayed () const
 Whether this system may be re-run over a tick that already happened.
virtual void init (FrameContext &ctx)
 Called once after all systems are registered, before the first update.
virtual void shutdown ()
 Called once on engine shutdown.
virtual void update (FrameContext &ctx)
 Execute this system for the current frame.

Static Public Member Functions

static void applyAnimation (const Animation &animation, Transform &transform)
 Pose transform as animation stands at its playhead.

Detailed Description

Advances every Animation component and writes its result into the entity's local Transform.

Runs on the fixed step, so a paused frame does not re-sample and clobber an authored Transform. Runs in SystemStage::Simulation, ahead of HierarchySystem, which resolves what it writes that frame.

Member Function Documentation

◆ fixedUpdate()

void Vkm::Engine::AnimationSystem::fixedUpdate ( FrameContext & ctx)
overridevirtual

Execute this system at the fixed simulation rate.

Called 0+ times per frame; the step is ctx.clock.getFixedStep().

Runs before any producer stage, so ctx.visibility and ctx.ui are null here. ctx.poses is set by SkeletalAnimationSystem's own fixedUpdate, so a later Simulation system reads this tick's pose.

Parameters
ctxThis frame's services; see above for which products are set.

Reimplemented from Vkm::Engine::System.

◆ applyAnimation()

void Vkm::Engine::AnimationSystem::applyAnimation ( const Animation & animation,
Transform & transform )
static

Pose transform as animation stands at its playhead.

An empty track leaves its channel as authored. Callable while the world is not stepping, to show a scrubbed playhead.

Parameters
animationThe clip and its playhead.
transformPose written.

The documentation for this class was generated from the following file: