reflect missing stuff

This commit is contained in:
Recep Aslantas
2024-03-21 02:21:07 +03:00
parent 8c81443f24
commit 8ea2fd1cd1
10 changed files with 85 additions and 0 deletions

View File

@@ -54,6 +54,7 @@
CGLM_INLINE vec2s glms_vec2_clamp(vec2s v, float minVal, float maxVal)
CGLM_INLINE vec2s glms_vec2_lerp(vec2s from, vec2s to, float t)
CGLM_INLINE vec2s glms_vec2_make(float * restrict src)
CGLM_INLINE vec2s glms_vec2_reflect(vec2s I, vec2s N)
*/
#ifndef cglms_vec2s_h
@@ -691,4 +692,19 @@ glms_vec2_(make)(const float * __restrict src) {
return dest;
}
/*!
* @brief reflection vector using an incident ray and a surface normal
*
* @param[in] I incident vector
* @param[in] N normalized normal vector
* @returns reflection result
*/
CGLM_INLINE
vec2s
glms_vec2_(reflect)(vec2s I, vec2s N) {
vec2s dest;
glm_vec2_reflect(I.raw, N.raw, dest.raw);
return dest;
}
#endif /* cglms_vec2s_h */