1 #ifndef BLAMK_MODEL_PART_HPP_
2 #define BLAMK_MODEL_PART_HPP_
4 #include "../graphics/EntityMesh.hpp"
5 #include "../graphics/glm.hpp"
11 #include <glm/gtc/quaternion.hpp>
16 class DirectionalLighting;
22 class TokenStreamReader;
28 glm::vec3 position = glm::vec3(0.0f, 0.0f, 0.0f);
29 glm::quat orientation = glm::quat(1.0f, 0.0f, 0.0f, 0.0f);
35 void Read(TokenStreamReader &, ResourceIndex &, const ShapeRegistry &);
38 const std::list<Part> &Children() const noexcept { return children; }
40 std::uint16_t Enumerate(std::uint16_t) noexcept;
41 void Index(std::vector<Part *> &) noexcept;
43 std::uint16_t ID() const noexcept { return id; }
45 glm::mat4 LocalTransform(const Instance &) const noexcept;
46 glm::mat4 GlobalTransform(const Instance &) const noexcept;
51 DirectionalLighting &) const;
56 std::list<Part> children;
57 std::vector<float> tex_map;
58 mutable std::unique_ptr<EntityMesh> mesh;
60 EntityMesh::ColorMod hsl_mod;
61 EntityMesh::ColorMod rgb_mod;