-
Notifications
You must be signed in to change notification settings - Fork 0
/
shape.h
54 lines (38 loc) · 1.04 KB
/
shape.h
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
#ifndef OBJECTS_SHAPE_H_
#define OBJECTS_SHAPE_H_
#include <map>
#include <vector>
#include <string>
#include "config.h"
#include "vector.h"
#include "renderer.h"
namespace objects {
// The Box class represents an axis aligned bounding box defined by two
// vertices; the lower left (ll) and the upper right (ur) corner.
class Box {
public:
// Constructs a box with the same corners as the argument.
explicit Box(const Box &b);
// Constructs a box out of the two corner vectors.
Box(Vector ll, Vector ur);
// Copies the contents of the argument box.
void operator=(const Box &b);
// Tests if the box intersects another box.
bool Intersects(const Box &box) const;
// Returns the lower left corner.
const Vector& ll() const;
// Returns the upper right corner.
const Vector& ur() const;
private:
Vector ll_, ur_; // The two corner vertices
};
// TODO
class Shape {
public:
Shape(const Box &bounds);
virtual void Render(const Renderer &renderer) const {};
private:
Box bounds_;
};
}
#endif // OBJECTS_SHAPE_H_