-
Notifications
You must be signed in to change notification settings - Fork 0
/
Rect.h
43 lines (29 loc) · 821 Bytes
/
Rect.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
#include "Advanced2D.h"
#pragma once
//***mod--floats to doubles
namespace Freedom {
class Rect {
public:
double left;
double top;
double right;
double bottom;
public:
Rect();
Rect(const Rect& rect);
Rect(int left,int top,int right,int bottom);
Rect(double left,double top,double right,double bottom);
virtual ~Rect() { }
void set(int left,int top,int right,int bottom);
void set(double left,double top,double right,double bottom);
double getLeft() { return left; }
double getTop() { return top; }
double getRight() { return right; }
double getBottom() { return bottom; }
double getWidth() { return right-left; }
double getHeight() { return bottom-top; }
bool isInside(Vector3 point);
bool isInside(int x, int y);
bool isInside(double x, double y);
};
};