fix refract

This commit is contained in:
Recep Aslantas
2024-07-15 12:41:23 +03:00
parent d491108386
commit 48839a38a1
6 changed files with 9 additions and 9 deletions

View File

@@ -1901,7 +1901,7 @@ TEST_IMPL(GLM_PREFIX, vec3_refract) {
eta = 1.33f / 1.0f;
r = GLM(vec3_refract)(v, N, eta, dest);
if (!(dest[0] == 0.0f && dest[1] == 0.0f && dest[2] == 0.0f)) {
ASSERT(dest[1] < -sqrtf(0.5f));
ASSERT(dest[1] < -0.3f);
ASSERT(r == true);
} else {
ASSERT(dest[0] == 0.0f && dest[1] == 0.0f && dest[2] == 0.0f);
@@ -1922,7 +1922,7 @@ TEST_IMPL(GLM_PREFIX, vec3_refract) {
/* Expect bending towards the normal, less bending than air to glass */
ASSERT(r == true);
ASSERT(dest[1] < -sqrtf(0.5f));
ASSERT(dest[1] < -0.6f);
/* Diamond to Air (eta = 2.42 / 1.0) */
eta = 2.42f / 1.0f;