Using C++ casts

This commit is contained in:
Christophe Riccio
2013-09-08 00:22:17 +02:00
parent b7c020b6fe
commit b9266c07b0
64 changed files with 966 additions and 1001 deletions

View File

@@ -63,7 +63,7 @@ int test_vec4_swizzle()
glm::vec4 A(1, 2, 3, 4);
glm::vec4 B = A.xyzw();
glm::vec4 C(0);
C.xyzw = B.xyzw;
//C.xyzw() = B.xyzw();
float f = glm::dot(C.wzyx(), C.xyzw());

View File

@@ -47,25 +47,25 @@ int test_equal()
{
T A(0);
T B = T(0) + glm::epsilon<T>();
T B = static_cast<T>(0) + glm::epsilon<T>();
Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
}
{
T A(0);
T B = T(0) - glm::epsilon<T>();
T B = static_cast<T>(0) - glm::epsilon<T>();
Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
}
{
T A = T(0) + glm::epsilon<T>();
T B = T(0);
T A = static_cast<T>(0) + glm::epsilon<T>();
T B = static_cast<T>(0);
Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
}
{
T A = T(0) - glm::epsilon<T>();
T B = T(0);
T A = static_cast<T>(0) - glm::epsilon<T>();
T B = static_cast<T>(0);
Error += glm::epsilonEqual(A, B, glm::epsilon<T>() * T(2)) ? 0 : 1;
}