aboutsummaryrefslogtreecommitdiff
path: root/src/basic/math.hpp
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-07-21 16:07:28 +0200
committerfschildt <florian.schildt@protonmail.com>2025-07-21 16:07:28 +0200
commitb46a0d9369fbaa1938f0968ab216bc2d564a9c37 (patch)
treec28b75187d01be9642af56a54a6101f51b25e4a7 /src/basic/math.hpp
first commitHEADmaster
Diffstat (limited to 'src/basic/math.hpp')
-rw-r--r--src/basic/math.hpp59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/basic/math.hpp b/src/basic/math.hpp
new file mode 100644
index 0000000..0f21181
--- /dev/null
+++ b/src/basic/math.hpp
@@ -0,0 +1,59 @@
+#pragma once
+
+#include <basic/defs.hpp>
+
+struct V2ST {
+ size_t x;
+ size_t y;
+
+ V2ST() = default;
+ V2ST(size_t x, size_t y);
+ V2ST(int32_t x, int32_t y);
+ bool operator==(V2ST &b);
+ bool operator==(const V2ST& other) const {
+ return x == other.x && y == other.y;
+ }
+};
+
+struct V2F32 {
+ float x;
+ float y;
+
+ V2F32() = default;
+ V2F32(float x, float y);
+ V2F32 operator/(float scalar);
+ V2F32 operator*(float scalar);
+ V2F32 operator+(V2F32 other);
+};
+
+struct V3F32 {
+ float x;
+ float y;
+ float z;
+
+ V3F32() = default;
+ V3F32(float x, float y, float z);
+ V3F32 operator/(float scalar);
+ V3F32 operator*(float scalar);
+};
+
+struct V4F32 {
+ float x;
+ float y;
+ float z;
+ float w;
+
+ V4F32() = default;
+ V4F32 (float x, float y, float z, float w);
+ V4F32 operator/(float scalar);
+ V4F32 operator*(float scalar);
+};
+
+struct V2I32 {
+ int32_t x;
+ int32_t y;
+
+ V2I32() = default;
+ V2I32 (int32_t x, int32_t y);
+ bool operator==(V2I32 other);
+};