From 0b8a907d1f99b20cc789806ff70394a18cbea1d9 Mon Sep 17 00:00:00 2001 From: Yann Herklotz Date: Sun, 13 Aug 2017 17:38:57 +0100 Subject: Updating docs --- collider_8hpp_source.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'collider_8hpp_source.html') diff --git a/collider_8hpp_source.html b/collider_8hpp_source.html index d10aa378..820b0712 100644 --- a/collider_8hpp_source.html +++ b/collider_8hpp_source.html @@ -68,11 +68,11 @@ $(function() {
collider.hpp
-
1 /* ----------------------------------------------------------------------------
2  * collider.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_COLLIDER_HPP
10 #define YAGE_COLLIDER_HPP
11 
12 #include <glm/glm.hpp>
13 
14 namespace yage
15 {
16 
17 // The Collider class helps collision detection by providing a general shape
18 // for different shapes to have their own collision algorithms.
19 class Collider
20 {
21 protected:
22  // position of the object
23  glm::vec2 position_;
24 
25  // size of the object
26  glm::vec2 size_;
27 
28 public:
29  Collider(const glm::vec2 &position, const glm::vec2 &size) : position_(position), size_(size) {}
30 
31  // virtual deconstructor for classes that inherits
32  virtual ~Collider() {}
33 
34  // function that checks if two colliders are colliding
35  virtual bool collides(const Collider &collider) const=0;
36 
37  // function that returns if a point is inside the shape
38  virtual bool inside(const glm::vec2 &point) const=0;
39 };
40 
41 } // yage
42 
43 #endif
Definition: camera2d.hpp:17
+
1 /* ----------------------------------------------------------------------------
2  * collider.hpp
3  *
4  * Copyright (c) 2017 Yann Herklotz Grave <ymherklotz@gmail.com> -- MIT License
5  * See file LICENSE for more details
6  * ----------------------------------------------------------------------------
7  */
8 
9 #ifndef YAGE_PHYSICS_COLLIDER_HPP
10 #define YAGE_PHYSICS_COLLIDER_HPP
11 
12 #include <glm/glm.hpp>
13 
14 namespace yage {
15 
16 // The Collider class helps collision detection by providing a general shape
17 // for different shapes to have their own collision algorithms.
18 class Collider {
19 protected:
20  // position of the object
21  glm::vec2 position_;
22 
23  // size of the object
24  glm::vec2 size_;
25 
26 public:
27  Collider(const glm::vec2& position, const glm::vec2& size)
28  : position_(position), size_(size) {}
29 
30  // function that checks if two colliders are colliding
31  virtual bool collides(const Collider& collider) const = 0;
32 
33  // function that returns if a point is inside the shape
34  virtual bool inside(const glm::vec2& point) const = 0;
35 };
36 
37 } // namespace yage
38 
39 #endif
Definition: camera2d.hpp:17
-- cgit