]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Entity.hpp
make entities removable
[blank.git] / src / world / Entity.hpp
index a5723f43b6cd6afb85b9e959d9ec23fbf9cb2aac..48646e80ddd656b353e7f105cab6a6ebc34621eb 100644 (file)
@@ -43,6 +43,10 @@ public:
 
        const Chunk::Pos ChunkCoords() const noexcept { return chunk; }
 
+       glm::vec3 AbsolutePosition() const noexcept {
+               return glm::vec3(chunk * Chunk::Extent()) + position;
+       }
+
        const glm::quat &AngularVelocity() const noexcept { return angular_velocity; }
        void AngularVelocity(const glm::quat &) noexcept;
 
@@ -53,6 +57,9 @@ public:
        glm::mat4 Transform(const Chunk::Pos &chunk_offset) const noexcept;
        Ray Aim(const Chunk::Pos &chunk_offset) const noexcept;
 
+       void Remove() noexcept { remove = true; }
+       bool CanRemove() const noexcept { return remove; }
+
        void Update(int dt) noexcept;
 
        void Draw() noexcept;
@@ -73,6 +80,7 @@ private:
        glm::mat4 rotation;
 
        bool world_collision;
+       bool remove;
 
 };