mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
add missing vec2 step
This commit is contained in:
@@ -205,6 +205,10 @@ CGLM_EXPORT
|
|||||||
void
|
void
|
||||||
glmc_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest);
|
glmc_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest);
|
||||||
|
|
||||||
|
CGLM_EXPORT
|
||||||
|
void
|
||||||
|
glmc_vec2_step(vec2 edge, vec2 x, vec2 dest);
|
||||||
|
|
||||||
CGLM_EXPORT
|
CGLM_EXPORT
|
||||||
void
|
void
|
||||||
glmc_vec2_steps(float edge, vec2 x, vec2 dest);
|
glmc_vec2_steps(float edge, vec2 x, vec2 dest);
|
||||||
|
|||||||
@@ -53,6 +53,7 @@
|
|||||||
CGLM_INLINE vec2s glms_vec2_minv(vec2s a, vec2s b)
|
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_clamp(vec2s v, float minVal, float maxVal)
|
||||||
CGLM_INLINE vec2s glms_vec2_lerp(vec2s from, vec2s to, float t)
|
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_make(float * restrict src)
|
||||||
CGLM_INLINE vec2s glms_vec2_reflect(vec2s v, vec2s n)
|
CGLM_INLINE vec2s glms_vec2_reflect(vec2s v, vec2s n)
|
||||||
CGLM_INLINE bool glms_vec2_refract(vec2s v, vec2s n, float eta, vec2s *dest)
|
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;
|
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
|
* @brief Create two dimensional vector from pointer
|
||||||
*
|
*
|
||||||
|
|||||||
@@ -54,6 +54,7 @@
|
|||||||
CGLM_INLINE void glm_vec2_minv(vec2 v1, vec2 v2, vec2 dest)
|
CGLM_INLINE void glm_vec2_minv(vec2 v1, vec2 v2, vec2 dest)
|
||||||
CGLM_INLINE void glm_vec2_clamp(vec2 v, float minVal, float maxVal)
|
CGLM_INLINE void glm_vec2_clamp(vec2 v, float minVal, float maxVal)
|
||||||
CGLM_INLINE void glm_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest)
|
CGLM_INLINE void glm_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest)
|
||||||
|
CGLM_INLINE void glm_vec2_step(vec2 edge, vec2 x, vec2 dest)
|
||||||
CGLM_INLINE void glm_vec2_make(float * restrict src, vec2 dest)
|
CGLM_INLINE void glm_vec2_make(float * restrict src, vec2 dest)
|
||||||
CGLM_INLINE void glm_vec2_reflect(vec2 v, vec2 n, vec2 dest)
|
CGLM_INLINE void glm_vec2_reflect(vec2 v, vec2 n, vec2 dest)
|
||||||
CGLM_INLINE void glm_vec2_refract(vec2 v, vec2 n, float eta, vec2 dest)
|
CGLM_INLINE void glm_vec2_refract(vec2 v, vec2 n, float eta, vec2 dest)
|
||||||
@@ -701,6 +702,20 @@ glm_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest) {
|
|||||||
glm_vec2_add(from, v, dest);
|
glm_vec2_add(from, v, dest);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* @brief threshold function
|
||||||
|
*
|
||||||
|
* @param[in] edge threshold
|
||||||
|
* @param[in] x value to test against threshold
|
||||||
|
* @param[out] dest destination
|
||||||
|
*/
|
||||||
|
CGLM_INLINE
|
||||||
|
void
|
||||||
|
glm_vec2_step(vec2 edge, vec2 x, vec2 dest) {
|
||||||
|
dest[0] = glm_step(edge[0], x[0]);
|
||||||
|
dest[1] = glm_step(edge[1], x[1]);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* @brief Create two dimensional vector from pointer
|
* @brief Create two dimensional vector from pointer
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user