aboutsummaryrefslogtreecommitdiff
path: root/include/math/vec4.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/math/vec4.h')
-rw-r--r--include/math/vec4.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/include/math/vec4.h b/include/math/vec4.h
index 60da464..5a797f6 100644
--- a/include/math/vec4.h
+++ b/include/math/vec4.h
@@ -112,8 +112,8 @@ static inline vec4 vec4_refract(vec4 v, vec4 n, R e) {
112 const R k = 1.0 - e * e * (1.0 - vec4_dot(n, v) * vec4_dot(n, v)); 112 const R k = 1.0 - e * e * (1.0 - vec4_dot(n, v) * vec4_dot(n, v));
113 assert(k >= 0); 113 assert(k >= 0);
114 // r = e*v - (e * dot(n,v) + sqrt(k)) * n 114 // r = e*v - (e * dot(n,v) + sqrt(k)) * n
115 return vec4_sub(vec4_scale(v, e), 115 return vec4_sub(
116 vec4_scale(n, e * vec4_dot(n, v) * sqrt(k))); 116 vec4_scale(v, e), vec4_scale(n, e * vec4_dot(n, v) * sqrt(k)));
117} 117}
118 118
119/// Elevate the vector to a power. 119/// Elevate the vector to a power.