summaryrefslogtreecommitdiff
path: root/include/hgerect.h
diff options
context:
space:
mode:
authorGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-01-12 14:43:14 +0000
committerGravatar chirs241097@gmail.com <chirs241097@gmail.com@c17bf020-1265-9734-9302-a83f62007ddb> 2014-01-12 14:43:14 +0000
commitc91847d549cc1c30eb15504a15ea9a6d5aa48165 (patch)
treeb978d575f08f5f87d3c21eb9a024164636d1918a /include/hgerect.h
downloadbullet-lab-remix-c91847d549cc1c30eb15504a15ea9a6d5aa48165.tar.xz
Diffstat (limited to 'include/hgerect.h')
-rw-r--r--include/hgerect.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/hgerect.h b/include/hgerect.h
new file mode 100644
index 0000000..9e26907
--- /dev/null
+++ b/include/hgerect.h
@@ -0,0 +1,35 @@
+/*
+** Haaf's Game Engine 1.7
+** Copyright (C) 2003-2007, Relish Games
+** hge.relishgames.com
+**
+** hgeRect helper class
+*/
+
+
+#ifndef HGERECT_H
+#define HGERECT_H
+
+
+class hgeRect
+{
+public:
+ float x1, y1, x2, y2;
+
+ hgeRect(float _x1, float _y1, float _x2, float _y2) {x1=_x1; y1=_y1; x2=_x2; y2=_y2; bClean=false; }
+ hgeRect() {bClean=true;}
+
+ void Clear() {bClean=true;}
+ bool IsClean() const {return bClean;}
+ void Set(float _x1, float _y1, float _x2, float _y2) { x1=_x1; x2=_x2; y1=_y1; y2=_y2; bClean=false; }
+ void SetRadius(float x, float y, float r) { x1=x-r; x2=x+r; y1=y-r; y2=y+r; bClean=false; }
+ void Encapsulate(float x, float y);
+ bool TestPoint(float x, float y) const;
+ bool Intersect(const hgeRect *rect) const;
+
+private:
+ bool bClean;
+};
+
+
+#endif