]> git.localhorst.tv Git - blank.git/blobdiff - src/world/Entity.hpp
randomly spawn entities around the player
[blank.git] / src / world / Entity.hpp
index 48646e80ddd656b353e7f105cab6a6ebc34621eb..25818c6f3da5666b671666a600ace04a9552e093 100644 (file)
@@ -38,6 +38,7 @@ public:
        void Velocity(const glm::vec3 &) noexcept;
 
        const Block::Pos &Position() const noexcept { return position; }
+       void Position(const Chunk::Pos &, const Block::Pos &) noexcept;
        void Position(const Block::Pos &) noexcept;
        void Move(const glm::vec3 &delta) noexcept;
 
@@ -46,6 +47,9 @@ public:
        glm::vec3 AbsolutePosition() const noexcept {
                return glm::vec3(chunk * Chunk::Extent()) + position;
        }
+       glm::vec3 AbsoluteDifference(const Entity &other) const noexcept {
+               return glm::vec3((chunk - other.chunk) * Chunk::Extent()) + position - other.position;
+       }
 
        const glm::quat &AngularVelocity() const noexcept { return angular_velocity; }
        void AngularVelocity(const glm::quat &) noexcept;