aboutsummaryrefslogtreecommitdiffstats
path: root/include/YAGE/Physics/collider.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/YAGE/Physics/collider.hpp')
-rw-r--r--include/YAGE/Physics/collider.hpp29
1 files changed, 14 insertions, 15 deletions
diff --git a/include/YAGE/Physics/collider.hpp b/include/YAGE/Physics/collider.hpp
index 716b7d4c..92b90de2 100644
--- a/include/YAGE/Physics/collider.hpp
+++ b/include/YAGE/Physics/collider.hpp
@@ -11,30 +11,29 @@
#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_;
+ // position of the object
+ glm::vec2 position_;
+
+ // size of the object
+ glm::vec2 size_;
- // size of the object
- 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;
+ // function that checks if two colliders are colliding
+ 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;
+ // function that returns if a point is inside the shape
+ virtual bool inside(const glm::vec2& point) const = 0;
};
-} // namespace yage
+} // namespace yage
#endif