]> git.localhorst.tv Git - blank.git/blob - src/model/Model.hpp
glm backwards compatibility
[blank.git] / src / model / Model.hpp
1 #ifndef BLANK_MODEL_MODEL_HPP_
2 #define BLANK_MODEL_MODEL_HPP_
3
4 #include "Part.hpp"
5 #include "../graphics/glm.hpp"
6
7 #include <cstdint>
8 #include <list>
9 #include <vector>
10 #include <glm/gtc/quaternion.hpp>
11
12
13 namespace blank {
14
15 class Instance;
16 class EntityMesh;
17
18 class Model {
19
20 public:
21         Model();
22
23         Model(const Model &) = delete;
24         Model &operator =(const Model &) = delete;
25
26         std::uint32_t ID() const noexcept { return id; }
27         void ID(std::uint32_t i) noexcept { id = i; }
28
29         Part &RootPart() noexcept { return root; }
30         const Part &RootPart() const noexcept { return root; }
31         Part &GetPart(std::size_t i) noexcept { return *part[i]; }
32         const Part &GetPart(std::size_t i) const noexcept { return *part[i]; }
33
34         void SetBody(std::uint16_t id) { body_id = id; }
35         const Part &GetBodyPart() const noexcept { return GetPart(body_id); }
36
37         void SetEyes(std::uint16_t id) { eyes_id = id; }
38         const Part &GetEyesPart() const noexcept { return GetPart(eyes_id); }
39
40         void Enumerate();
41         void Instantiate(Instance &) const;
42
43 private:
44         std::uint32_t id;
45         Part root;
46         std::vector<Part *> part;
47         std::uint16_t body_id;
48         std::uint16_t eyes_id;
49
50 };
51
52 }
53
54 #endif