]> git.localhorst.tv Git - blank.git/blobdiff - src/model/CompositeModel.hpp
send entity visual from server to client
[blank.git] / src / model / CompositeModel.hpp
index b548a9c8485dbe20337f7e5af52959fbcee6ae3e..947db0140b4a32219a26b44b57301070ed65ada9 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,7 +11,7 @@
 
 namespace blank {
 
-class DirectionalLighting;
+class CompositeInstance;
 class EntityModel;
 
 class CompositeModel {
@@ -19,6 +22,12 @@ 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; }
 
@@ -38,12 +47,16 @@ 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;
 
+       std::uint32_t id;
+
+       AABB bounds;
+
        glm::vec3 position;
        glm::quat orientation;