summaryrefslogtreecommitdiffhomepage
path: root/src/hole-cut.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2024-07-28 08:43:26 +0200
committerStanislaw Halik <sthalik@misaki.pl>2024-07-28 08:43:26 +0200
commit74a123a9fdf72fa4a2d0322de011d10b69898191 (patch)
tree7aaee73b410fc1a247ff7885dc56226a7a25b5b6 /src/hole-cut.hpp
parenteeaaef1547891b2a0d5c03a967d134a85458a36d (diff)
move out from hole.hpp to hole-cut.hpp
Now the latter doesn't require including <src/object.hpp>.
Diffstat (limited to 'src/hole-cut.hpp')
-rw-r--r--src/hole-cut.hpp22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/hole-cut.hpp b/src/hole-cut.hpp
new file mode 100644
index 00000000..52eeaf71
--- /dev/null
+++ b/src/hole-cut.hpp
@@ -0,0 +1,22 @@
+#pragma once
+#include <mg/Vector2.h>
+#include <Magnum/DimensionTraits.h>
+
+namespace floormat {
+
+template<typename T>
+struct CutResult
+{
+ using Vec2 = VectorTypeFor<2, T>;
+ struct bbox { Vec2 position; Vector2ub bbox_size; };
+ struct rect { Vec2 min, max; };
+
+ static CutResult cut(bbox input, bbox hole);
+ static CutResult cut(Vec2 r0, Vec2 r1, Vec2 h0, Vec2 h1);
+
+ std::array<rect, 8> array;
+ uint8_t size = 0;
+ bool found = false;
+};
+
+} // namespace floormat