SHARE
TWEET

AnimationManager.h

Codeblocks Jul 30th, 2016 32 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #ifndef ANIMATIONMGR_H
  2. #define ANIMATIONMGR_H
  3. #pragma once
  4.  
  5. #include <string>
  6. #include <vector>
  7.  
  8. namespace Leadwerks {
  9.     class Entity;
  10.    
  11.     typedef void(*func_ptr)(Entity* entity, const std::string&);
  12.     class Animation {
  13.     public:
  14.         Animation() {};
  15.         ~Animation() {};
  16.  
  17.         long blendstart;
  18.         long blendfinish;
  19.         int blendtime;
  20.         std::string sequence;
  21.         int length;
  22.         float speed;
  23.         bool mode;
  24.         bool endOfSequenceReached = false;
  25.         func_ptr endHook;
  26.     };
  27.  
  28.  
  29.     class AnimationManager {
  30.     public:
  31.         AnimationManager(Entity* pEntity);
  32.         virtual ~AnimationManager();
  33.         virtual void SetAnimationSequence(const std::string& pSequence, const float pSpeed = 1.0f, const int pBlendTime = 500, const bool pMode = false, func_ptr pEndHook = nullptr);
  34.         virtual void Update();
  35.         void ClearAnimations();
  36.     private:
  37.         Entity* entity;
  38.         short frameoffset;
  39.         std::vector<Animation*> animations;
  40.     };
  41. }
  42. #endif
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Top