X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=src%2Fgraphics%2Fglm.hpp;h=8003f0b751ada30fa9aff5fe6bea160afd2eb497;hb=3b0a4ba59825b2d6a47e9d997736742edf55240c;hp=1c39ba5e059ae75ff48d187d0a022b1fbb8154fd;hpb=be413456f57da06e918ae7bf4c4f35e5198ff7ce;p=blobs.git diff --git a/src/graphics/glm.hpp b/src/graphics/glm.hpp index 1c39ba5..8003f0b 100644 --- a/src/graphics/glm.hpp +++ b/src/graphics/glm.hpp @@ -5,7 +5,10 @@ # define GLM_FORCE_RADIANS 1 #endif +#include #include +#include +#include // GLM moved tvec[1234] from glm::detail to glm in 0.9.6 @@ -20,4 +23,17 @@ namespace glm { #endif +template +inline bool allzero(const T &v) noexcept { + return glm::length2(v) < + std::numeric_limits::epsilon() + * std::numeric_limits::epsilon(); +} + +template +inline bool anynan(const T &v) noexcept { + return glm::any(glm::isnan(v)); +} + + #endif