]> git.localhorst.tv Git - blank.git/blob - src/model/Instance.hpp
store shapes in models rather than meshes
[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 <memory>
7 #include <vector>
8 #include <glm/glm.hpp>
9 #include <glm/gtc/quaternion.hpp>
10
11
12 namespace blank {
13
14 class DirectionalLighting;
15 class EntityMesh;
16 class Model;
17 class Part;
18
19 class Instance {
20
21         friend class Model;
22         friend class Part;
23
24 public:
25         Instance();
26         ~Instance();
27
28         Instance(const Instance &);
29         Instance &operator =(const Instance &);
30
31         operator bool() const noexcept { return model; }
32         const Model &GetModel() const noexcept { return *model; }
33
34         void Render(const glm::mat4 &, DirectionalLighting &);
35
36         void SetTextures(const std::vector<float> &t);
37         void SetHSLModifier(const glm::vec3 &m);
38         void SetRGBModifier(const glm::vec3 &m);
39
40 private:
41         const Model *model;
42         std::vector<Part::State> state;
43         std::vector<std::unique_ptr<EntityMesh>> mesh;
44
45         std::vector<float> tex_map;
46         glm::vec3 hsl_mod;
47         glm::vec3 rgb_mod;
48
49 };
50
51 }
52
53 #endif