]> git.localhorst.tv Git - blank.git/blob - src/world/EntityCollision.hpp
server save path argument without trailing slash
[blank.git] / src / world / EntityCollision.hpp
1 #ifndef BLANK_WORLD_ENTITYCOLLISION_HPP_
2 #define BLANK_WORLD_ENTITYCOLLISION_HPP_
3
4
5 namespace blank {
6
7 class Entity;
8
9 struct EntityCollision {
10
11         float depth;
12         glm::vec3 normal;
13
14         EntityCollision()
15         : depth(0.0f), normal(0.0f), entity(nullptr) { }
16         EntityCollision(Entity *e, float d, const glm::vec3 &n);
17         ~EntityCollision();
18
19         EntityCollision(const EntityCollision &);
20         EntityCollision &operator =(const EntityCollision &);
21
22         /// check if an actual collision
23         operator bool() const noexcept { return entity; }
24
25         Entity &GetEntity() noexcept { return *entity; }
26         const Entity &GetEntity() const noexcept { return *entity; }
27
28 private:
29         Entity *entity;
30
31 };
32
33 }
34
35 #endif