summary refs log tree commit diff
path: root/src/Math
diff options
context:
space:
mode:
authorMel <einebeere@gmail.com>2023-06-12 23:07:36 +0200
committerMel <einebeere@gmail.com>2023-06-12 23:07:36 +0200
commit92ac46df6afa8ee76f972cceb681cf32658f84a2 (patch)
tree6ff89b9d6e8e0568f346b5f7b8b9e7ba3e74211e /src/Math
parentd0de60dc33df75fbcacb53a09568b14d0fd48cb9 (diff)
downloadmeowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.tar.zst
meowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.zip
Start generation from player position
Diffstat (limited to 'src/Math')
-rw-r--r--src/Math/Vector.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/Math/Vector.hpp b/src/Math/Vector.hpp
index 9cc2d75..ccfa556 100644
--- a/src/Math/Vector.hpp
+++ b/src/Math/Vector.hpp
@@ -65,6 +65,10 @@ public:
         return map([=](auto x) { return x / m; });
     }
 
+    T distance(Vector<S, T> other) const {
+        return (*this - other).magnitude();
+    }
+
     Vector<S, T> abs() const {
         return map([=](auto x) { return std::abs(x); });
     }