X-Git-Url: http://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fworld%2FEntity.hpp;h=c0d9a0bd858159bbd969f225d15abf16f689fa92;hb=bb83e2c9db0fc9746eb076a0ecbd5c64f899d7eb;hp=ef5e4e32eb92ce4667e233d85f3b485a3aeffcf6;hpb=5304d1e3c1a1e90d474307f4f7eea812a61e483c;p=blank.git diff --git a/src/world/Entity.hpp b/src/world/Entity.hpp index ef5e4e3..c0d9a0b 100644 --- a/src/world/Entity.hpp +++ b/src/world/Entity.hpp @@ -2,9 +2,10 @@ #define BLANK_WORLD_ENTITY_HPP_ #include "Chunk.hpp" -#include "../model/CompositeModel.hpp" +#include "../model/CompositeInstance.hpp" #include "../model/geometry.hpp" +#include #include #include #include @@ -20,8 +21,11 @@ class Entity { public: Entity() noexcept; - CompositeModel &GetModel() noexcept { return model; } - const CompositeModel &GetModel() const noexcept { return model; } + CompositeInstance &GetModel() noexcept { return model; } + const CompositeInstance &GetModel() const noexcept { return model; } + + std::uint32_t ID() const noexcept { return id; } + void ID(std::uint32_t i) noexcept { id = i; } const std::string &Name() const noexcept { return name; } void Name(const std::string &n) { name = n; } @@ -71,12 +75,13 @@ public: void Update(int dt) noexcept; void Render(const glm::mat4 &M, DirectionalLighting &prog) noexcept { - model.Render(M, prog); + if (model) model.Render(M, prog); } private: - CompositeModel model; + CompositeInstance model; + std::uint32_t id; std::string name; AABB bounds;