23#include "guillaume/systems/animation.hpp"
24#include "guillaume/theme/tokens.hpp"
33 , _lastTime(std::chrono::steady_clock::now())
40 const float engineDelta = _engine.getDeltaTime();
42 if (engineDelta > 0.0f) {
43 _deltaTime = engineDelta;
47 const auto now = std::chrono::steady_clock::now();
48 const std::chrono::duration<float> elapsed = now - _lastTime;
50 _deltaTime = elapsed.count();
60 const float deltaTime =
std::size_t Identifier
The key under which an entity's components are stored. Systems and components refer to entities by th...
SystemFiller(Phase phase)
ComponentType & getComponent(const ecs::Entity::Identifier &entityIdentifier)
Get a component of an entity from the bound registry, to read or modify it.
bool requireComponent(const ecs::Entity::Identifier &entityIdentifier)
Tell whether an entity has a component, and log a warning naming the entity and the component when it...
void update(const ecs::Entity::Identifier &entityIdentifier) override
Advance the animation of one entity by the frame time, clamped to theme::MotionScale::MaxFrameStep.
void prepare(void) override
Read the time of the current frame, once per frame.
Animation(utility::Engine &engine)
Create the system, in the Event phase.
static constexpr float MaxFrameStep
Longest frame step the animation system integrates, in seconds, so a stalled frame does not skip a wh...
State. Every class here is plain data attached to an entity.
The entity-component-system core, independent of any widget.
Rules. Every class here runs each frame on the entities that have the components it declares.