]> git.localhorst.tv Git - blank.git/blobdiff - src/model/Part.hpp
glm backwards compatibility
[blank.git] / src / model / Part.hpp
index f71efc5425a1580a992ba1b857e38e8ef9797a44..6499bb7478ed30ec34cd5077e702e34dbfbea85c 100644 (file)
@@ -1,25 +1,24 @@
 #ifndef BLAMK_MODEL_PART_HPP_
 #define BLAMK_MODEL_PART_HPP_
 
-#include "geometry.hpp"
+#include "../graphics/EntityMesh.hpp"
+#include "../graphics/glm.hpp"
 
 #include <cstdint>
 #include <list>
 #include <memory>
 #include <vector>
-#include <glm/glm.hpp>
 #include <glm/gtc/quaternion.hpp>
 
 
 namespace blank {
 
 class DirectionalLighting;
-class EntityMesh;
 class Instance;
 class Model;
+class ResourceIndex;
 class Shape;
 class ShapeRegistry;
-class TextureIndex;
 class TokenStreamReader;
 
 struct Part {
@@ -33,7 +32,7 @@ public:
        Part();
        ~Part();
 
-       void Read(TokenStreamReader &, TextureIndex &, const ShapeRegistry &);
+       void Read(TokenStreamReader &, ResourceIndex &, const ShapeRegistry &);
 
        Part &AddChild();
        const std::list<Part> &Children() const noexcept { return children; }
@@ -41,6 +40,8 @@ public:
        std::uint16_t Enumerate(std::uint16_t) noexcept;
        void Index(std::vector<Part *> &) noexcept;
 
+       std::uint16_t ID() const noexcept { return id; }
+
        glm::mat4 LocalTransform(const Instance &) const noexcept;
        glm::mat4 GlobalTransform(const Instance &) const noexcept;
 
@@ -56,8 +57,8 @@ private:
        std::vector<float> tex_map;
        mutable std::unique_ptr<EntityMesh> mesh;
        State initial;
-       glm::vec3 hsl_mod;
-       glm::vec3 rgb_mod;
+       EntityMesh::ColorMod hsl_mod;
+       EntityMesh::ColorMod rgb_mod;
        std::uint16_t id;
 
 };