mirror of
https://github.com/g-truc/glm.git
synced 2025-04-16 10:16:11 +00:00
Add test_isLeft to gtx_vector_query.cpp
This commit is contained in:
parent
49aa226974
commit
47753b5826
1 changed files with 15 additions and 0 deletions
|
@ -34,6 +34,8 @@
|
|||
#include <glm/vec4.hpp>
|
||||
#include <glm/gtx/vector_query.hpp>
|
||||
|
||||
using namespace glm;
|
||||
|
||||
int test_areCollinear()
|
||||
{
|
||||
int Error(0);
|
||||
|
@ -96,6 +98,18 @@ int test_areOrthonormal()
|
|||
return Error;
|
||||
}
|
||||
|
||||
int test_isLeft()
|
||||
{
|
||||
int Error(0);
|
||||
|
||||
Error += isLeft(vec2(1, 1), vec2(2.5, 2), vec2(1.305, 3.062)) ? 0 : 1;
|
||||
Error += isLeft(vec2(1.278, 1.176), vec2(0.734, 2.257), vec2(0.5, 1.5)) ? 0 : 1;
|
||||
Error += isLeft(vec2(1.183, 1.326), vec2(0.923, 0.695), vec2(2, 0)) ? 0 : 1;
|
||||
Error += !isLeft(vec2(0.923, 0.695), vec2(1.183, 1.326), vec2(2, 0)) ? 0 : 1;
|
||||
Error += isLeft(vec2(0, 0), vec2(1, 0), vec2(-1, 1)) ? 0 : 1;
|
||||
return Error;
|
||||
}
|
||||
|
||||
int main()
|
||||
{
|
||||
int Error(0);
|
||||
|
@ -105,6 +119,7 @@ int main()
|
|||
Error += test_isNormalized();
|
||||
Error += test_isNull();
|
||||
Error += test_areOrthonormal();
|
||||
Error += test_isLeft();
|
||||
|
||||
return Error;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue