Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef ANIMATIONMGR_H
- #define ANIMATIONMGR_H
- #pragma once
- #include <string>
- #include <vector>
- namespace Leadwerks {
- class Entity;
- typedef void(*func_ptr)(Entity* entity, const std::string&);
- class Animation {
- public:
- Animation() {};
- ~Animation() {};
- long blendstart;
- long blendfinish;
- int blendtime;
- std::string sequence;
- int length;
- float speed;
- bool mode;
- bool endOfSequenceReached = false;
- func_ptr endHook;
- };
- class AnimationManager {
- public:
- AnimationManager(Entity* pEntity);
- virtual ~AnimationManager();
- virtual void SetAnimationSequence(const std::string& pSequence, const float pSpeed = 1.0f, const int pBlendTime = 500, const bool pMode = false, func_ptr pEndHook = nullptr);
- virtual void Update();
- void ClearAnimations();
- private:
- Entity* entity;
- short frameoffset;
- std::vector<Animation*> animations;
- };
- }
- #endif
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement