]> git.localhorst.tv Git - blank.git/blobdiff - src/world/EntityCollision.hpp
added block orientation test
[blank.git] / src / world / EntityCollision.hpp
index be1a82d9085a52c632323c3746f0ba5f461f69da..ec7cd60748592dee12fc4afaa8fec0cabda3eb2f 100644 (file)
@@ -8,19 +8,26 @@ class Entity;
 
 struct EntityCollision {
 
-       Entity *entity;
-
        float depth;
        glm::vec3 normal;
 
        EntityCollision()
-       : entity(nullptr), depth(0.0f), normal(0.0f) { }
-       EntityCollision(Entity *e, float d, const glm::vec3 &n)
-       : entity(e), depth(d), normal(n) { }
+       : depth(0.0f), normal(0.0f), entity(nullptr) { }
+       EntityCollision(Entity *e, float d, const glm::vec3 &n);
+       ~EntityCollision();
+
+       EntityCollision(const EntityCollision &);
+       EntityCollision &operator =(const EntityCollision &);
 
        /// check if an actual collision
        operator bool() const noexcept { return entity; }
 
+       Entity &GetEntity() noexcept { return *entity; }
+       const Entity &GetEntity() const noexcept { return *entity; }
+
+private:
+       Entity *entity;
+
 };
 
 }