mirror of
https://github.com/recp/cglm.git
synced 2026-01-01 05:06:13 +00:00
Merge branch 'master' of https://github.com/recp/cglm
This commit is contained in:
@@ -73,6 +73,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec2_clamp(ivec2 v, int minVal, int maxVal);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec2_abs(ivec2 v, ivec2 dest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -73,6 +73,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec3_clamp(ivec3 v, int minVal, int maxVal);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec3_abs(ivec3 v, ivec3 dest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -73,6 +73,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec4_clamp(ivec4 v, int minVal, int maxVal);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_ivec4_abs(ivec4 v, ivec4 dest);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -145,6 +145,10 @@ CGLM_EXPORT
|
||||
void
|
||||
glmc_vec2_clamp(vec2 v, float minval, float maxval);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_vec2_abs(vec2 v, vec2 dest);
|
||||
|
||||
CGLM_EXPORT
|
||||
void
|
||||
glmc_vec2_lerp(vec2 from, vec2 to, float t, vec2 dest);
|
||||
|
||||
@@ -22,6 +22,7 @@ FUNCTIONS:
|
||||
CGLM_INLINE void glm_ivec2_maxv(ivec2 a, ivec2 b, ivec2 dest)
|
||||
CGLM_INLINE void glm_ivec2_minv(ivec2 a, ivec2 b, ivec2 dest)
|
||||
CGLM_INLINE void glm_ivec2_clamp(ivec2 v, int minVal, int maxVal)
|
||||
CGLM_INLINE void glm_ivec2_abs(ivec2 v, ivec2 dest)
|
||||
*/
|
||||
|
||||
#ifndef cglm_ivec2_h
|
||||
@@ -239,4 +240,17 @@ glm_ivec2_clamp(ivec2 v, int minVal, int maxVal) {
|
||||
v[1] = maxVal;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief absolute value of v
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_ivec2_abs(ivec2 v, ivec2 dest) {
|
||||
dest[0] = abs(v[0]);
|
||||
dest[1] = abs(v[1]);
|
||||
}
|
||||
|
||||
#endif /* cglm_ivec2_h */
|
||||
|
||||
@@ -22,6 +22,7 @@ FUNCTIONS:
|
||||
CGLM_INLINE void glm_ivec3_maxv(ivec3 a, ivec3 b, ivec3 dest)
|
||||
CGLM_INLINE void glm_ivec3_minv(ivec3 a, ivec3 b, ivec3 dest)
|
||||
CGLM_INLINE void glm_ivec3_clamp(ivec3 v, int minVal, int maxVal)
|
||||
CGLM_INLINE void glm_ivec3_abs(ivec3 v, ivec3 dest)
|
||||
*/
|
||||
|
||||
#ifndef cglm_ivec3_h
|
||||
@@ -255,4 +256,18 @@ glm_ivec3_clamp(ivec3 v, int minVal, int maxVal) {
|
||||
v[2] = maxVal;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief absolute value of v
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_ivec3_abs(ivec3 v, ivec3 dest) {
|
||||
dest[0] = abs(v[0]);
|
||||
dest[1] = abs(v[1]);
|
||||
dest[2] = abs(v[2]);
|
||||
}
|
||||
|
||||
#endif /* cglm_ivec3_h */
|
||||
|
||||
@@ -22,6 +22,7 @@ FUNCTIONS:
|
||||
CGLM_INLINE void glm_ivec4_maxv(ivec4 a, ivec4 b, ivec4 dest)
|
||||
CGLM_INLINE void glm_ivec4_minv(ivec4 a, ivec4 b, ivec4 dest)
|
||||
CGLM_INLINE void glm_ivec4_clamp(ivec4 v, int minVal, int maxVal)
|
||||
CGLM_INLINE void glm_ivec4_abs(ivec4 v, ivec4 dest)
|
||||
*/
|
||||
|
||||
#ifndef cglm_ivec4_h
|
||||
@@ -272,4 +273,19 @@ glm_ivec4_clamp(ivec4 v, int minVal, int maxVal) {
|
||||
v[3] = maxVal;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief absolute value of v
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_ivec4_abs(ivec4 v, ivec4 dest) {
|
||||
dest[0] = abs(v[0]);
|
||||
dest[1] = abs(v[1]);
|
||||
dest[2] = abs(v[2]);
|
||||
dest[3] = abs(v[3]);
|
||||
}
|
||||
|
||||
#endif /* cglm_ivec4_h */
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
CGLM_INLINE bool glm_vec2_isinf(vec2 v);
|
||||
CGLM_INLINE bool glm_vec2_isvalid(vec2 v);
|
||||
CGLM_INLINE void glm_vec2_sign(vec2 v, vec2 dest);
|
||||
CGLM_INLINE void glm_vec2_abs(vec2 v, vec2 dest);
|
||||
CGLM_INLINE void glm_vec2_sqrt(vec2 v, vec2 dest);
|
||||
CGLM_INLINE void glm_vec2_complex_mul(vec2 a, vec2 b, vec2 dest)
|
||||
CGLM_INLINE void glm_vec2_complex_div(vec2 a, vec2 b, vec2 dest)
|
||||
@@ -176,6 +177,19 @@ glm_vec2_sign(vec2 v, vec2 dest) {
|
||||
dest[1] = glm_signf(v[1]);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief absolute value of v
|
||||
*
|
||||
* @param[in] v vector
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_vec2_abs(vec2 v, vec2 dest) {
|
||||
dest[0] = fabsf(v[0]);
|
||||
dest[1] = fabsf(v[1]);
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief square root of each vector item
|
||||
*
|
||||
@@ -237,5 +251,4 @@ glm_vec2_complex_conjugate(vec2 a, vec2 dest) {
|
||||
dest[1] = -a[1];
|
||||
}
|
||||
|
||||
|
||||
#endif /* cglm_vec2_ext_h */
|
||||
|
||||
Reference in New Issue
Block a user