]> git.localhorst.tv Git - blank.git/blob - src/model/Model.hpp
use entity's eyes to aim
[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
36         const Part &GetEyesPart() const noexcept { return GetPart(eyes_id); }
37
38         void Enumerate();
39         void Instantiate(Instance &) const;
40
41 private:
42         std::uint32_t id;
43         Part root;
44         std::vector<Part *> part;
45         std::uint16_t eyes_id;
46
47 };
48
49 }
50
51 #endif