diff options
| author | Mel <einebeere@gmail.com> | 2024-02-05 13:48:13 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-02-05 13:48:13 +0100 |
| commit | 091bf9e418ffdcf36e1735ed78d544f3d1b86785 (patch) | |
| tree | 58b1cd88d9822b14c90da757cc26acb64bf9bad5 /src/Math/Vector.hpp | |
| parent | bcb89e0554e43d37daf74b3ef6e466b6630752cd (diff) | |
| download | meowcraft-091bf9e418ffdcf36e1735ed78d544f3d1b86785.tar.zst meowcraft-091bf9e418ffdcf36e1735ed78d544f3d1b86785.zip | |
More precise collision detection (and less NaNs)
Diffstat (limited to 'src/Math/Vector.hpp')
| -rw-r--r-- | src/Math/Vector.hpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/Math/Vector.hpp b/src/Math/Vector.hpp index 7d07d5c..3525e42 100644 --- a/src/Math/Vector.hpp +++ b/src/Math/Vector.hpp @@ -125,6 +125,15 @@ struct Vector { return mostly_equal(zero()); } + Bool is_nan() const { + for (UInt i = 0; i < S; i++) { + if (std::isnan(elements[i])) { + return true; + } + } + return false; + } + T operator[](USize index) const { return elements[index]; } |
