]> git.localhorst.tv Git - blank.git/blobdiff - src/model/CompositeModel.hpp
model -> mesh
[blank.git] / src / model / CompositeModel.hpp
index b548a9c8485dbe20337f7e5af52959fbcee6ae3e..4b3d2a9b9549ddcc4b2b8940131d66d52a21303d 100644 (file)
@@ -1,6 +1,9 @@
 #ifndef BLANK_MODEL_COMPOSITEMODEL_HPP_
 #define BLANK_MODEL_COMPOSITEMODEL_HPP_
 
+#include "geometry.hpp"
+
+#include <cstdint>
 #include <list>
 #include <glm/glm.hpp>
 #include <glm/gtc/quaternion.hpp>
@@ -8,8 +11,8 @@
 
 namespace blank {
 
-class DirectionalLighting;
-class EntityModel;
+class CompositeInstance;
+class EntityMesh;
 
 class CompositeModel {
 
@@ -19,16 +22,22 @@ public:
        CompositeModel(const CompositeModel &) = delete;
        CompositeModel &operator =(const CompositeModel &) = delete;
 
+       std::uint32_t ID() const noexcept { return id; }
+       void ID(std::uint32_t i) noexcept { id = i; }
+
+       const AABB &Bounds() const noexcept { return bounds; }
+       void Bounds(const AABB &b) noexcept { bounds = b; }
+
        const glm::vec3 &Position() const noexcept { return position; }
        void Position(const glm::vec3 &p) noexcept { position = p; }
 
        const glm::quat &Orientation() const noexcept { return orientation; }
        void Orientation(const glm::quat &o) noexcept { orientation = o; }
 
-       bool HasNodeModel() const noexcept { return node_model; }
-       void SetNodeModel(const EntityModel *m) noexcept { node_model = m; }
+       bool HasNodeMesh() const noexcept { return node_mesh; }
+       void SetNodeMesh(const EntityMesh *m) noexcept { node_mesh = m; }
 
-       const EntityModel &NodeModel() const noexcept { return *node_model; }
+       const EntityMesh &NodeMesh() const noexcept { return *node_mesh; }
 
        CompositeModel &AddPart();
        bool HasParent() const noexcept { return parent; }
@@ -38,11 +47,15 @@ public:
        glm::mat4 LocalTransform() const noexcept;
        glm::mat4 GlobalTransform() const noexcept;
 
-       void Render(const glm::mat4 &, DirectionalLighting &) const;
+       void Instantiate(CompositeInstance &) const;
 
 private:
        CompositeModel *parent;
-       const EntityModel *node_model;
+       const EntityMesh *node_mesh;
+
+       std::uint32_t id;
+
+       AABB bounds;
 
        glm::vec3 position;
        glm::quat orientation;