summaryrefslogtreecommitdiffstats
path: root/src/math/Rect.h
diff options
context:
space:
mode:
authoraap <aap@papnet.eu>2019-05-15 16:52:37 +0200
committeraap <aap@papnet.eu>2019-05-15 16:52:37 +0200
commit600bf0351476a5a21aabb5429132ddf7f52ac0b9 (patch)
treed8e48b3a581679e33830fb7c98ed69e1e242e2c2 /src/math/Rect.h
downloadre3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.gz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.bz2
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.lz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.xz
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.tar.zst
re3-600bf0351476a5a21aabb5429132ddf7f52ac0b9.zip
Diffstat (limited to '')
-rw-r--r--src/math/Rect.h31
1 files changed, 31 insertions, 0 deletions
diff --git a/src/math/Rect.h b/src/math/Rect.h
new file mode 100644
index 00000000..212645fa
--- /dev/null
+++ b/src/math/Rect.h
@@ -0,0 +1,31 @@
+#pragma once
+
+#pragma once
+
+class CRect
+{
+public:
+ float left; // x min
+ float top; // y max
+ float right; // x max
+ float bottom; // y min
+
+ CRect(void){
+ left = 1000000.0f;
+ bottom = 1000000.0f;
+ right = -1000000.0f;
+ top = -1000000.0f;
+ }
+ CRect(float l, float b, float r, float t){
+ left = l;
+ bottom = b;
+ right = r;
+ top = t;
+ }
+ void ContainPoint(CVector const &v){
+ if(v.x < left) left = v.x;
+ if(v.x > right) right = v.x;
+ if(v.y < bottom) bottom = v.y;
+ if(v.y > top) top = v.y;
+ }
+};