]> git.localhorst.tv Git - blank.git/blob - src/model/Instance.hpp
80c8f710fd14e7a0f60988a2fc6b0b73122a1110
[blank.git] / src / model / Instance.hpp
1 #ifndef BLANK_MODEL_INSTANCE_HPP_
2 #define BLANK_MODEL_INSTANCE_HPP_
3
4 #include "Part.hpp"
5
6 #include <vector>
7 #include <glm/glm.hpp>
8 #include <glm/gtc/quaternion.hpp>
9
10
11 namespace blank {
12
13 class DirectionalLighting;
14 class Model;
15 class Part;
16
17 class Instance {
18
19         friend class Model;
20         friend class Part;
21
22 public:
23         Instance();
24         ~Instance();
25
26         operator bool() const noexcept { return model; }
27         const Model &GetModel() const noexcept { return *model; }
28
29         glm::mat4 BodyTransform() const noexcept;
30         Part::State &BodyState() noexcept;
31
32         glm::mat4 EyesTransform() const noexcept;
33         Part::State &EyesState() noexcept;
34
35         void Render(const glm::mat4 &, DirectionalLighting &);
36
37 private:
38         const Model *model;
39         std::vector<Part::State> state;
40
41 };
42
43 }
44
45 #endif