diff options
author | Yann Herklotz <ymherklotz@gmail.com> | 2017-08-24 00:25:31 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-24 00:25:31 +0100 |
commit | a326354ea6fccf76665a4212bf14daeba0f52ec8 (patch) | |
tree | 18cd2deb0c30b38d8ca7c5305735d2323259e020 /include/YAGE/Physics/collider.hpp | |
parent | 0a49874288f92c120d7e165550eb6dbbe1ef7307 (diff) | |
parent | 5403490b941f7c031bf1aafdb91b1098f69edbf2 (diff) | |
download | YAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.tar.gz YAGE-a326354ea6fccf76665a4212bf14daeba0f52ec8.zip |
Merge pull request #3 from ymherklotz/developv0.1.0
Merge develop to master
Diffstat (limited to 'include/YAGE/Physics/collider.hpp')
-rw-r--r-- | include/YAGE/Physics/collider.hpp | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/include/YAGE/Physics/collider.hpp b/include/YAGE/Physics/collider.hpp index 92b90de2..7b4ff060 100644 --- a/include/YAGE/Physics/collider.hpp +++ b/include/YAGE/Physics/collider.hpp @@ -11,11 +11,13 @@ #include <glm/glm.hpp> -namespace yage { +namespace yage +{ // The Collider class helps collision detection by providing a general shape // for different shapes to have their own collision algorithms. -class Collider { +class Collider +{ protected: // position of the object glm::vec2 position_; @@ -24,16 +26,18 @@ protected: glm::vec2 size_; public: - Collider(const glm::vec2& position, const glm::vec2& size) - : position_(position), size_(size) {} + Collider(const glm::vec2 &position, const glm::vec2 &size) + : position_(position), size_(size) + { + } // function that checks if two colliders are colliding - virtual bool collides(const Collider& collider) const = 0; + virtual bool collides(const Collider &collider) const = 0; // function that returns if a point is inside the shape - virtual bool inside(const glm::vec2& point) const = 0; + virtual bool inside(const glm::vec2 &point) const = 0; }; -} // namespace yage +} // namespace yage #endif |