]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Entity.hpp
special treatment for players
[blank.git] / src / world / Entity.hpp
index ef5e4e32eb92ce4667e233d85f3b485a3aeffcf6..a3811427332628250761bad32210bc64103ea9de 100644 (file)
@@ -2,7 +2,7 @@
 #define BLANK_WORLD_ENTITY_HPP_
 
 #include "Chunk.hpp"
-#include "../model/CompositeModel.hpp"
+#include "../model/CompositeInstance.hpp"
 #include "../model/geometry.hpp"
 
 #include <string>
@@ -20,8 +20,8 @@ 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; }
 
        const std::string &Name() const noexcept { return name; }
        void Name(const std::string &n) { name = n; }
@@ -71,11 +71,11 @@ 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::string name;