diff options
| author | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
|---|---|---|
| committer | Nicolas James <Eele1Ephe7uZahRie@tutanota.com> | 2025-02-12 21:57:46 +1100 |
| commit | e4483eca01b48b943cd0461e24a74ae1a3139ed4 (patch) | |
| tree | ed58c3c246e3af1af337697695d780aa31f6ad9a /src/shared/math.cc | |
| parent | 1cc08c51eb4b0f95c30c0a98ad1fc5ad3459b2df (diff) | |
Update to most recent version (old initial commit)
Diffstat (limited to 'src/shared/math.cc')
| -rw-r--r-- | src/shared/math.cc | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/src/shared/math.cc b/src/shared/math.cc deleted file mode 100644 index 80eba81..0000000 --- a/src/shared/math.cc +++ /dev/null @@ -1,23 +0,0 @@ -#include "shared/math.hh" - -namespace shared { -namespace math { - -glm::vec3 angle_to_dir(const angles& ang) noexcept { - const float x = std::cos(ang.pitch) * std::cos(ang.yaw); - const float y = std::sin(ang.pitch); - const float z = std::cos(ang.pitch) * std::sin(ang.yaw); - return {x, y, z}; -} - -bool is_inside_draw(const coords& a, const coords& b, - const std::int32_t draw_distance) noexcept { - const auto x2 = (a.x - b.x) * (a.x - b.x); - const auto z2 = (a.z - b.z) * (a.z - b.z); - const auto dd2 = draw_distance * draw_distance; - - return (x2 < dd2 - z2) && (z2 < dd2 - x2); -} - -} // namespace math -} // namespace shared |
