22 if (comp->animationIndex() ==
U32_MAX)
24 comp->playAnimation(0);
27 comp->_parentTimeStamp += comp->playAnimations() ? dt * comp->animationSpeed() : 0.0;
41 if (!animator ||
COMPARE(comp->_parentTimeStamp, comp->_currentTimeStamp))
46 comp->_currentTimeStamp = comp->_parentTimeStamp;
47 const D64 timeStampS = Time::MillisecondsToSeconds<D64>(comp->_currentTimeStamp);
49 if (comp->playAnimations())
54 if (comp->animationIndex() != comp->previousAnimationIndex() && comp->animationIndex() !=
U32_MAX)
56 comp->previousAnimationIndex(comp->animationIndex());
80 if (comp->frameTicked())
82 comp->parentSGN()->SendEvent(
98 if (aComp !=
nullptr && !aComp->saveCache(outputBuffer))
114 if (aComp !=
nullptr && !aComp->loadCache(inputBuffer))
#define PROFILE_SCOPE_AUTO(CATEGORY)
static bool GlobalAnimationState() noexcept
bool saveCache(const SceneGraphNode *sgn, ByteBuffer &outputBuffer) override
AnimationSystem(ECS::ECSEngine &parentEngine, PlatformContext &context)
void PostUpdate(F32 dt) override
void Update(F32 dt) override
void toggleAnimationState(bool state) noexcept
bool loadCache(SceneGraphNode *sgn, ByteBuffer &inputBuffer) override
void PreUpdate(F32 dt) override
bool getAnimationState() const noexcept
virtual bool saveCache(const SceneGraphNode *sgn, ByteBuffer &outputBuffer)
void PreUpdate(F32 dt) override
virtual bool loadCache(SceneGraphNode *sgn, ByteBuffer &inputBuffer)
void PostUpdate(F32 dt) override
void Update(F32 dt) override
vector< AnimationComponent * > _componentCache
AnimEvaluator::FrameIndex frameIndexForTimeStamp(const U32 animationIndex, const D64 dt) const
constexpr Optick::Category::Type Scene
Handle console commands that start with a forward slash.
bool COMPARE(T X, U Y) noexcept