17 for (
auto entityId : entities) {
35 }
catch (
const std::exception &) {
47 if (!animationSet->
hasClip(currentClipName)) {
57 float newTimer = animation->
getTimer() + deltaTime;
68 if (nextFrame >=
static_cast<int>(clip.
frames.size())) {
74 nextFrame =
static_cast<int>(clip.
frames.size()) - 1;
93 if (frameIndex >= 0 && frameIndex <
static_cast<int>(clip.
frames.size())) {
100 return (1ULL << getComponentType<Animation>()) | (1ULL << getComponentType<AnimationSet>()) |
101 (1ULL << getComponentType<Sprite>());
Component containing all available animations for an entity.
bool hasClip(const std::string &clipName) const
Check if a clip exists.
const AnimationClip * getClip(const std::string &clipName) const
Get a specific animation clip.
ComponentMask getComponentMask() const override
Gets the component mask for this system.
void update(Registry ®istry, float deltaTime) override
Updates all entity animations.
Component managing current animation playback state.
void setCurrentFrameIndex(int frameIndex)
Set the current frame index.
std::string getCurrentClipName() const
Get the current animation clip name.
bool isPlaying() const
Check if animation is playing.
int getCurrentFrameIndex() const
Get the current frame index.
void setCurrentClipName(const std::string &clipName)
Set the current animation clip name.
float getTimer() const
Get the playback timer.
void setPlaying(bool playing)
Set the playing state.
void setTimer(float timer)
Set the playback timer.
Manages entities, their signatures and component type registrations.
std::vector< Address > getEntitiesWithMask(Signature requiredMask)
Get all entities matching a specific component mask.
T & getComponent(Address address)
Get a component from an entity.
bool hasComponent(Address address)
Check if an entity has a specific component.
Component representing a visual sprite from a texture.
void setSourceRect(Rectangle sourceRect)
Set the source rectangle.
Maximum number of distinct component types supported by the Registry.
std::uint64_t ComponentMask
Type alias for component bitmask.
Defines a sequence of frames for an animation.
std::string nextClip
Next clip name after completion (optional)
bool loop
Whether animation loops.
float frameDuration
Duration per frame in seconds.
std::vector< Rectangle > frames
Frame rectangles in the texture.