feat(animation): Animation System — sprite state machine, frame events (RF4.9)#63
Merged
feat(animation): Animation System — sprite state machine, frame events (RF4.9)#63
Conversation
…(RF4.9) - Add AnimationComponents.hpp: FrameRect, AnimationClip, AnimationTransition, AnimationState, Animator component (HashMap state machine, frame events) - Add AnimationSystem.hpp: ECS::ISystem impl with onUpdate() iterating Animator+Sprite, state machine evaluation, frame advance, frame events - Add test_animation.cpp: 22 tests covering defaults, state transitions, frame clamping/looping, pause/resume/setSpeed/play/isPlaying - Update Caffeine.hpp with animation includes - Update tests/CMakeLists.txt to always compile test_animation.cpp - Update docs/fase4/animation.md (status ✅, API rewrite) and README.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
AnimationComponents.hpp(always compiled) andAnimationSystem.hpp(ECS ISystem)test_animation.cppcovering defaults, transitions, frame math, imperative APIFiles
src/animation/AnimationComponents.hppFrameRect,AnimationClip,AnimationTransition,AnimationState,Animatorsrc/animation/AnimationSystem.hppAnimationSystem : ECS::ISystemtests/test_animation.cppsrc/Caffeine.hpptests/CMakeLists.txttest_animation.cppadded to base sourcesdocs/fase4/animation.mddocs/fase4/README.mdDesign Notes
onUpdate(World&, f32)matches actualISysteminterface (notupdate(World&, f64)from spec)Sprite::frameIndexupdated per frame (engine has nosrcRecton Sprite)HashMap<FixedString<32>, AnimationState>— works viaoperator==linear searchhasExitTimeon transitions: waits for clip to finish before checking conditionplay/pause/resume/setSpeed/isPlaying) takesWorld&+Entity— consistent with PhysicsSystem2D pattern