X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fmodel%2FCompositeModel.hpp;h=947db0140b4a32219a26b44b57301070ed65ada9;hb=d4c71969df4f6b5e6b750c98268d30ca6784908b;hp=b548a9c8485dbe20337f7e5af52959fbcee6ae3e;hpb=d02daa5a4805dc3184884f3a7cd7620e5787adcb;p=blank.git diff --git a/src/model/CompositeModel.hpp b/src/model/CompositeModel.hpp index b548a9c..947db01 100644 --- a/src/model/CompositeModel.hpp +++ b/src/model/CompositeModel.hpp @@ -1,6 +1,9 @@ #ifndef BLANK_MODEL_COMPOSITEMODEL_HPP_ #define BLANK_MODEL_COMPOSITEMODEL_HPP_ +#include "geometry.hpp" + +#include #include #include #include @@ -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;