diff options
Diffstat (limited to 'src/common/math.hpp')
| -rw-r--r-- | src/common/math.hpp | 61 |
1 files changed, 61 insertions, 0 deletions
diff --git a/src/common/math.hpp b/src/common/math.hpp new file mode 100644 index 0000000..de856e8 --- /dev/null +++ b/src/common/math.hpp @@ -0,0 +1,61 @@ +#pragma once + + +#include <common/defs.hpp> + +#include <cstddef> +#include <cstdint> + + +struct V2ST { + size_t x; + size_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 operator/(float scalar); + V2F32 operator*(float scalar); + V2F32 operator+(V2F32 other); +}; + +struct 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 operator/(float scalar); + V4F32 operator*(float scalar); +}; + +struct V2I32 { + int32_t x; + int32_t y; + + bool operator==(V2I32 other); +}; + +struct Color { + float r; + float g; + float b; + float a; +}; + |
