CSEngine
Loading...
Searching...
No Matches
Animation.h
1//
2// Created by ounols on 19. 9. 15.
3//
4
5#pragma once
6
7#include "../../SObject.h"
8#include "../Matrix.h"
9#include "../Quaternion.h"
10#include "../../Manager/ResMgr.h"
11#include "../../MacroDef.h"
12#include "AnimationUtil.h"
13#include <map>
14#include <string>
15#include <list>
16#include <utility>
17
18namespace CSE {
19
20 class Animation : public SResource {
21 public:
22 Animation() {
23 SetUndestroyable(true);
24 }
25
26 Animation(float totalTime, std::list<KeyFrame*> keyframes) {
27 SetUndestroyable(true);
28 m_length = totalTime;
29 m_keyframes = std::move(keyframes);
30 }
31
32 ~Animation() override = default;
33
34 void SetKeyframe(float totalTime, std::list<KeyFrame*> keyframes);
35
36 void Exterminate() override;
37
38 float GetLength() const {
39 return m_length;
40 }
41
42 std::list<KeyFrame*> GetKeyFrames() const {
43 return m_keyframes;
44 }
45
46 protected:
47 void Init(const AssetMgr::AssetReference* asset) override;
48
49 private:
50 float m_length = 0;
51 std::list<KeyFrame*> m_keyframes;
52
53 };
54
55}