Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #if !defined( PUPPETEERANIMATING_H )
- #define PUPPETEERANIMATING_H
- #pragma once
- #include "../Core/base.h"
- #include "../Core/puppeteer.h"
- namespace Leadwerks
- {
- typedef void(*func_ptr)(Entity* entity, const std::string&);
- class Animation
- {
- public:
- Animation() {};
- virtual ~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 Object
- {
- 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;
- };
- class PuppeteerAnimating : public Puppeteer
- {
- public:
- PuppeteerAnimating(Entity* pEntity);
- virtual ~PuppeteerAnimating();
- virtual void Start();
- virtual void PostStart() {};
- virtual void Collision(Entity* pEntity, float* position, float* normal, float speed) {};
- virtual void Draw(Camera* camera);
- virtual void DrawEach() {};
- virtual void PostRender(Context* context) {};
- virtual void UpdateMatrix() {};
- virtual void UpdatePhysics() {};
- virtual void UpdateWorld() {};
- virtual void Use(Entity* pCaller);
- private:
- AnimationManager animationmanager;
- };
- }
- #endif // PUPPETEERANIMATING_H
Add Comment
Please, Sign In to add comment