Added rotate test

This commit is contained in:
Christophe Riccio 2018-08-16 09:57:34 +02:00
parent 8f12f96787
commit ef9f9f8028

View File

@ -36,12 +36,26 @@ static int test_scale()
return Error;
}
static int test_rotate()
{
int Error = 0;
glm::vec4 const A(1.0f, 0.0f, 0.0f, 1.0f);
glm::mat4 const R = glm::rotate(glm::mat4(1.0f), glm::radians(90.f), glm::vec3(0, 0, 1));
glm::vec4 const B = R * A;
Error += glm::all(glm::equal(B, glm::vec4(0.0f, 1.0f, 0.0f, 1.0f), 0.0001f)) ? 0 : 1;
return Error;
}
int main()
{
int Error = 0;
Error += test_translate();
Error += test_scale();
Error += test_rotate();
return Error;
}