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 RESOURCE_DEFINE_CONSTRUCTOR(Animation);
23
24 Animation(float totalTime, std::list<KeyFrame*> keyframes) : CSE::SResource("Animation") {
25 SetUndestroyable(true);
26 m_length = totalTime;
27 m_keyframes = std::move(keyframes);
28 }
29
30 ~Animation() override = default;
31
32 void SetKeyframe(float totalTime, std::list<KeyFrame*> keyframes);
33
34 void Exterminate() override;
35
36 float GetLength() const {
37 return m_length;
38 }
39
40 std::list<KeyFrame*> GetKeyFrames() const {
41 return m_keyframes;
42 }
43
44 void SetValue(std::string name_str, Arguments value) override;
45
46 std::string PrintValue() const override;
47
48 protected:
49 void Init(const AssetMgr::AssetReference* asset) override;
50
51 private:
52 float m_length = 0;
53 std::list<KeyFrame*> m_keyframes;
54
55 };
56
57}
void SetValue(std::string name_str, Arguments value) override
Definition Animation.cpp:33