add missing vec2 step

This commit is contained in:
Marcin
2025-01-18 19:17:58 +00:00
parent 5cffcf74c4
commit 6bc980f3d9
3 changed files with 35 additions and 0 deletions

View File

@@ -53,6 +53,7 @@
CGLM_INLINE vec2s glms_vec2_minv(vec2s a, vec2s b)
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_step(vec2s edge, vec2s x)
CGLM_INLINE vec2s glms_vec2_make(float * restrict src)
CGLM_INLINE vec2s glms_vec2_reflect(vec2s v, vec2s n)
CGLM_INLINE bool glms_vec2_refract(vec2s v, vec2s n, float eta, vec2s *dest)
@@ -679,6 +680,21 @@ glms_vec2_(lerp)(vec2s from, vec2s to, float t) {
return r;
}
/*!
* @brief threshold function
*
* @param[in] edge threshold
* @param[in] x value to test against threshold
* @returns destination
*/
CGLM_INLINE
vec2s
glms_vec2_(step)(vec2s edge, vec2s x) {
vec2s r;
glm_vec2_step(edge.raw, x.raw, r.raw);
return r;
}
/*!
* @brief Create two dimensional vector from pointer
*