- Added missing equal and notEqual with epsilon for matrix types in EXT_vector_relational

This commit is contained in:
Groove
2018-07-26 00:03:31 +02:00
parent afde3b4645
commit 751bc4f7f7
4 changed files with 91 additions and 9 deletions

View File

@@ -1,5 +1,6 @@
#include <glm/ext/vector_relational.hpp>
#include <glm/vec2.hpp>
#include <glm/mat4x3.hpp>
int test_equal()
{
@@ -13,6 +14,9 @@ int test_equal()
Error += !glm::any(glm::equal(glm::vec2(1.01f), glm::vec2(1.02f), 0.001f)) ? 0 : 1;
Error += !glm::any(glm::equal(glm::vec2(1.01f), glm::vec2(1.02f), glm::vec2(0.001f))) ? 0 : 1;
Error += glm::all(glm::equal(glm::mat4x3(1), glm::mat4x3(1), 0.001f)) ? 0 : 1;
Error += glm::all(glm::equal(glm::mat4x3(1), glm::mat4x3(2), glm::vec4(0.001f))) ? 1 : 0;
return Error;
}
@@ -28,6 +32,9 @@ int test_notEqual()
Error += !glm::any(glm::notEqual(glm::vec2(1.01f), glm::vec2(1.02f), 0.1f)) ? 0 : 1;
Error += !glm::any(glm::notEqual(glm::vec2(1.01f), glm::vec2(1.02f), glm::vec2(0.1f))) ? 0 : 1;
Error += !glm::any(glm::notEqual(glm::mat4x3(1), glm::mat4x3(1), 0.001f)) ? 0 : 1;
Error += !glm::any(glm::notEqual(glm::mat4x3(1), glm::mat4x3(2), glm::vec4(0.001f))) ? 1 : 0;
return Error;
}