diff --git a/glm/gtx/rotate_vector.hpp b/glm/gtx/rotate_vector.hpp index 7306f6b4..f918c6c2 100644 --- a/glm/gtx/rotate_vector.hpp +++ b/glm/gtx/rotate_vector.hpp @@ -14,8 +14,10 @@ #pragma once // Dependency: -#include "../glm.hpp" #include "../gtx/transform.hpp" +#include "../gtc/epsilon.hpp" +#include "../ext/vector_relational.hpp" +#include "../glm.hpp" #ifndef GLM_ENABLE_EXPERIMENTAL # error "GLM: GLM_GTX_rotate_vector is an experimental extension and may change in the future. Use #define GLM_ENABLE_EXPERIMENTAL before including it, if you really want to use it." diff --git a/glm/gtx/rotate_vector.inl b/glm/gtx/rotate_vector.inl index 5183d37d..d883f24e 100644 --- a/glm/gtx/rotate_vector.inl +++ b/glm/gtx/rotate_vector.inl @@ -177,8 +177,8 @@ namespace glm vec<3, T, Q> const& Up ) { - if(all(equal(Normal, Up))) - return mat<4, 4, T, Q>(T(1)); + if(all(equal(Normal, Up, epsilon()))) + return mat<4, 4, T, Q>(static_cast(1)); vec<3, T, Q> RotationAxis = cross(Up, Normal); T Angle = acos(dot(Normal, Up)); diff --git a/test/gtx/gtx_rotate_vector.cpp b/test/gtx/gtx_rotate_vector.cpp index 970ca4cf..becd63f4 100644 --- a/test/gtx/gtx_rotate_vector.cpp +++ b/test/gtx/gtx_rotate_vector.cpp @@ -1,6 +1,7 @@ #define GLM_ENABLE_EXPERIMENTAL -#include #include +#include +#include int test_rotate() {