aboutsummaryrefslogtreecommitdiff
path: root/src/shared/math.hh
diff options
context:
space:
mode:
authorNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
committerNicolas James <Eele1Ephe7uZahRie@tutanota.com>2025-02-12 21:57:46 +1100
commite4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch)
treeed58c3c246e3af1af337697695d780aa31f6ad9a /src/shared/math.hh
parent1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff)
Update to most recent version (old initial commit)
Diffstat (limited to 'src/shared/math.hh')
-rw-r--r--src/shared/math.hh53
1 files changed, 0 insertions, 53 deletions
diff --git a/src/shared/math.hh b/src/shared/math.hh
deleted file mode 100644
index 5f03ab4..0000000
--- a/src/shared/math.hh
+++ /dev/null
@@ -1,53 +0,0 @@
-#ifndef SHARED_MATH_HH_
-#define SHARED_MATH_HH_
-
-#include <compare>
-
-#include <glm/glm.hpp>
-#include <glm/gtc/matrix_transform.hpp>
-#include <glm/gtc/type_ptr.hpp>
-
-namespace shared {
-namespace math {
-
-// 2D coordinates.
-struct coords {
- std::int32_t x;
- std::int32_t z;
- coords operator+(const coords& c) const noexcept {
- auto ret = *this;
- ret.x += c.x;
- ret.z += c.z;
- return ret;
- }
- coords operator-(const coords& c) const noexcept {
- auto ret = *this;
- ret.x -= c.x;
- ret.z -= c.z;
- return ret;
- }
- auto operator<=>(const coords& c) const noexcept = default;
-};
-
-struct angles {
- float pitch;
- float yaw;
- angles operator+(const angles& a) const noexcept {
- auto ret = *this;
- ret.pitch += a.pitch;
- ret.yaw += a.yaw;
- return ret;
- }
-};
-
-// Returns a vector pointing in the direction of pitch + yaw.
-glm::vec3 angle_to_dir(const angles& ang) noexcept;
-
-bool is_inside_draw(const shared::math::coords& a,
- const shared::math::coords& b,
- const std::int32_t draw_distance) noexcept;
-
-} // namespace math
-} // namespace shared
-
-#endif