This repository has been archived by the owner on Jan 18, 2024. It is now read-only.
forked from rpbpolis/spic-prj-api
-
Notifications
You must be signed in to change notification settings - Fork 1
/
BoxCollider.hpp
63 lines (52 loc) · 1.53 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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#ifndef BOXCOLLIDER_H_
#define BOXCOLLIDER_H_
#include "Collider.hpp"
namespace spic {
/**
* @brief A collider which represents a rectangular collision area.
* @spicapi
*/
class BoxCollider : public Collider {
public:
/**
* @brief Constructor.
* @sharedapi
*/
BoxCollider();
/**
* @brief Constructor.
* @param width The width for the box collider.
* @param height The height for the box collider.
* @sharedapi
*/
BoxCollider(double width, double height);
/**
* @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_