diff options
| author | Mel <einebeere@gmail.com> | 2023-06-12 23:07:36 +0200 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2023-06-12 23:07:36 +0200 |
| commit | 92ac46df6afa8ee76f972cceb681cf32658f84a2 (patch) | |
| tree | 6ff89b9d6e8e0568f346b5f7b8b9e7ba3e74211e /src/Math/Vector.hpp | |
| parent | d0de60dc33df75fbcacb53a09568b14d0fd48cb9 (diff) | |
| download | meowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.tar.zst meowcraft-92ac46df6afa8ee76f972cceb681cf32658f84a2.zip | |
Start generation from player position
Diffstat (limited to 'src/Math/Vector.hpp')
| -rw-r--r-- | src/Math/Vector.hpp | 4 |
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); }); } |
