summaryrefslogtreecommitdiff
path: root/source/libs/asura-lib-utils/math/rect.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'source/libs/asura-lib-utils/math/rect.hpp')
-rw-r--r--source/libs/asura-lib-utils/math/rect.hpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/source/libs/asura-lib-utils/math/rect.hpp b/source/libs/asura-lib-utils/math/rect.hpp
index f635007..1751634 100644
--- a/source/libs/asura-lib-utils/math/rect.hpp
+++ b/source/libs/asura-lib-utils/math/rect.hpp
@@ -13,8 +13,20 @@ namespace AsuraEngine
Rect();
~Rect(T x, T y, T w, T h);
- template <typename U>
- explicit Rect(const Rect<U>& 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;
};
@@ -25,8 +37,11 @@ namespace AsuraEngine
typedef Rect<int> Recti;
typedef Rect<unsigned int> Rectu;
typedef Rect<float> Rectf;
+ typedef Rect<long> Reftl;
}
}
+namespace AEMath = AsuraEngine::Math;
+
#endif \ No newline at end of file