Fixed ticket #147 refract for scalar

This commit is contained in:
Christophe Riccio
2011-11-14 18:13:18 +00:00
parent 390498ef87
commit 369e929910
2 changed files with 28 additions and 2 deletions

View File

@@ -34,17 +34,24 @@ int test_refract()
{
int Error = 0;
{
float A(1.0f);
float B(1.0f);
float C = glm::refract(A, B, 0.5f);
Error += C == 1.0f ? 0 : 1;
}
{
glm::vec2 A(1.0f, 0.0f);
glm::vec2 B(0.0f, 1.0f);
glm::vec2 C = glm::reflect(A, B);
glm::vec2 C = glm::refract(A, B, 0.5f);
Error += C == glm::vec2(-1.0, 0.0) ? 0 : 1;
}
{
glm::dvec2 A(1.0f, 0.0f);
glm::dvec2 B(0.0f, 1.0f);
glm::dvec2 C = glm::reflect(A, B);
glm::dvec2 C = glm::refract(A, B, 0.5);
Error += C == glm::dvec2(-1.0, 0.0) ? 0 : 1;
}