mods boilerplate

This commit is contained in:
Marcin
2025-01-18 16:47:35 +00:00
parent fbf0014c82
commit e14c730d5c
9 changed files with 75 additions and 0 deletions

View File

@@ -197,6 +197,10 @@ CGLM_EXPORT
void
glmc_vec2_floor(vec2 v, vec2 dest);
CGLM_EXPORT
void
glmc_vec2_mods(vec2 v, float s, vec2 dest);
CGLM_EXPORT
void
glmc_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest);

View File

@@ -326,6 +326,10 @@ CGLM_EXPORT
void
glmc_vec3_floor(vec3 v, vec3 dest);
CGLM_EXPORT
void
glmc_vec3_mods(vec3 v, float s, vec3 dest);
CGLM_EXPORT
float
glmc_vec3_hadd(vec3 v);

View File

@@ -303,6 +303,10 @@ CGLM_EXPORT
void
glmc_vec4_floor(vec4 v, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_mods(vec4 v, float s, vec4 dest);
CGLM_EXPORT
float
glmc_vec4_hadd(vec4 v);

View File

@@ -229,6 +229,21 @@ glms_vec2_(floor)(vec2s v) {
return r;
}
/*!
* @brief mod of each vector item by scalar
*
* @param[in] v vector
* @param[in] s scalar
* @returns destination vector
*/
CGLM_INLINE
vec2s
glms_vec2_(mods)(vec2s v, float s) {
vec2s r;
glm_vec2_mods(v.raw, s, r.raw);
return r;
}
/*!
* @brief square root of each vector item
*

View File

@@ -245,6 +245,21 @@ glms_vec3_(floor)(vec3s v) {
return r;
}
/*!
* @brief mod of each vector item by scalar
*
* @param[in] v vector
* @param[in] s scalar
* @returns destination vector
*/
CGLM_INLINE
vec3s
glms_vec3_(mods)(vec3s v, float s) {
vec3s r;
glm_vec3_mods(v.raw, s, r.raw);
return r;
}
/*!
* @brief vector reduction by summation
* @warning could overflow

View File

@@ -245,6 +245,21 @@ glms_vec4_(floor)(vec4s v) {
return r;
}
/*!
* @brief mod of each vector item by scalar
*
* @param[in] v vector
* @param[in] s scalar
* @returns destination vector
*/
CGLM_INLINE
vec4s
glms_vec4_(mods)(vec4s v, float s) {
vec4s r;
glm_vec4_mods(v.raw, s, r.raw);
return r;
}
/*!
* @brief vector reduction by summation
* @warning could overflow