-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathBoxCollider.hpp
48 lines (39 loc) · 1.13 KB
/
BoxCollider.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#ifndef BOXCOLLIDER_H_
#define BOXCOLLIDER_H_
#include "Collider.hpp"
namespace spic {
/**
* @brief A collider which represents a rectangular collision area.
*/
class BoxCollider : public Collider {
public:
/**
* @brief The collider's width
* @return The current width
* @spicapi
*/
double Width() const { return width; }
/**
* @brief The collider's width
* @param newWidth The desired width
* @spicapi
*/
void Width(double newWidth) { width = newWidth; }
/**
* @brief The collider's height
* @return The current height
* @spicapi
*/
double Height() const { return height; }
/**
* @brief The collider's height
* @param newHeight The desired height
* @spicapi
*/
void Height(double newHeight) { height = newHeight; }
private:
double width;
double height;
};
}
#endif // BOXCOLLIDER_H_