blob: 282b6066c049a631e7bdf221cde6a11ba4b6416e (
plain)
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 __ASURA_ENGINE_RECT_H__
#define __ASURA_ENGINE_RECT_H__
namespace AsuraEngine
{
namespace Math
{
template<typename T>
struct Rect
{
public:
Rect();
Rect(T x, T y, T w, T h);
~Rect();
///
/// x,yǷrectڡ
///
bool Contain(T x, T y);
///
/// Ƿཻཻľ
///
bool Intersect(const Rect& src, Rect& intersection);
///
/// Ƿཻཻľ
///
static bool Intersect(const Rect<T>& src1, const Rect<T>& src2, Rect<T>& intersection);
T x, y, w, h;
};
#include "Rect.inl"
// Define the most common types
typedef Rect<int> Recti;
typedef Rect<unsigned int> Rectu;
typedef Rect<float> Rectf;
typedef Rect<long> Reftl;
}
}
namespace AEMath = AsuraEngine::Math;
#endif
|