Moved test to GTX tests
This commit is contained in:
parent
39580d05f0
commit
e43633dbe6
@ -1,6 +1,3 @@
|
|||||||
#ifndef GLM_EXT_VIRTREV_XSTREAM_HPP
|
|
||||||
#define GLM_EXT_VIRTREV_XSTREAM_HPP
|
|
||||||
|
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
|
// OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net)
|
||||||
// Virtrev SDK copyright matrem (matrem84.free.fr)
|
// Virtrev SDK copyright matrem (matrem84.free.fr)
|
||||||
@ -15,6 +12,9 @@
|
|||||||
// - GLM_GTX_matrix_selection
|
// - GLM_GTX_matrix_selection
|
||||||
///////////////////////////////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////////////////////////////
|
||||||
|
|
||||||
|
#ifndef GLM_EXT_VIRTREV_XSTREAM_HPP
|
||||||
|
#define GLM_EXT_VIRTREV_XSTREAM_HPP
|
||||||
|
|
||||||
#include "../glm.hpp"
|
#include "../glm.hpp"
|
||||||
#include "../gtc/matrix_access.hpp"
|
#include "../gtc/matrix_access.hpp"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
@ -29,67 +29,12 @@ int test_quat_type()
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int test_quat_slerp()
|
|
||||||
{
|
|
||||||
int Error = 0;
|
|
||||||
|
|
||||||
glm::quat A(glm::vec3(0, 0, 1));
|
|
||||||
glm::quat B(glm::vec3(0, 1, 0));
|
|
||||||
glm::quat C = glm::mix(A, B, 0.5f);
|
|
||||||
glm::quat D(glm::normalize(glm::vec3(0, 1, 1)));
|
|
||||||
|
|
||||||
Error += C == D ? 0 : 1;
|
|
||||||
|
|
||||||
return Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_quat_length()
|
|
||||||
{
|
|
||||||
int Error = 0;
|
|
||||||
|
|
||||||
float A = glm::length(glm::quat(45.0f, glm::vec3(0, 0, 1)));
|
|
||||||
Error += A == 1.0f ? 0 : 1;
|
|
||||||
float B = glm::length(glm::quat(90.0f, glm::vec3(0, 0, 2)));
|
|
||||||
Error += B == 2.0f ? 0 : 1;
|
|
||||||
|
|
||||||
return Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
int test_quat_normalize()
|
|
||||||
{
|
|
||||||
int Error = 0;
|
|
||||||
|
|
||||||
{
|
|
||||||
glm::quat Q(45.0f, glm::vec3(0, 0, 1));
|
|
||||||
glm::quat N = glm::normalize(Q);
|
|
||||||
float L = glm::length(N);
|
|
||||||
Error += L == 1.0f ? 0 : 1;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
glm::quat Q(45.0f, glm::vec3(0, 0, 2));
|
|
||||||
glm::quat N = glm::normalize(Q);
|
|
||||||
float L = glm::length(N);
|
|
||||||
Error += L == 1.0f ? 0 : 1;
|
|
||||||
}
|
|
||||||
{
|
|
||||||
glm::quat Q(45.0f, glm::vec3(1, 2, 3));
|
|
||||||
glm::quat N = glm::normalize(Q);
|
|
||||||
float L = glm::length(N);
|
|
||||||
Error += L == 1.0f ? 0 : 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
return Error;
|
|
||||||
}
|
|
||||||
|
|
||||||
int main()
|
int main()
|
||||||
{
|
{
|
||||||
int Error = 0;
|
int Error = 0;
|
||||||
|
|
||||||
Error += test_quat_precision();
|
Error += test_quat_precision();
|
||||||
Error += test_quat_type();
|
Error += test_quat_type();
|
||||||
Error += test_quat_slerp();
|
|
||||||
Error += test_quat_length();
|
|
||||||
Error += test_quat_normalize();
|
|
||||||
|
|
||||||
return Error;
|
return Error;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user