]> git.localhorst.tv Git - blank.git/blob - src/model/Model.hpp
apply pitch to head instead of body
[blank.git] / src / model / Model.hpp
1 #ifndef BLANK_MODEL_MODEL_HPP_
2 #define BLANK_MODEL_MODEL_HPP_
3
4 #include "Part.hpp"
5
6 #include <cstdint>
7 #include <list>
8 #include <vector>
9 #include <glm/glm.hpp>
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 SetEyes(std::uint16_t id) { eyes_id = id; }
35         const Part &GetEyesPart() const noexcept { return GetPart(eyes_id); }
36
37         void Enumerate();
38         void Instantiate(Instance &) const;
39
40 private:
41         std::uint32_t id;
42         Part root;
43         std::vector<Part *> part;
44         std::uint16_t eyes_id;
45
46 };
47
48 }
49
50 #endif