Merge branch 'master' into feature/glm_vec2_make

This commit is contained in:
Recep Aslantas
2023-07-02 22:03:40 +03:00
committed by GitHub
16 changed files with 168 additions and 7 deletions

View File

@@ -306,6 +306,10 @@ CGLM_EXPORT
void
glmc_vec3_sqrt(vec3 v, vec3 dest);
CGLM_EXPORT
void
glmc_vec3_make(float * __restrict src, vec3 dest);
#ifdef __cplusplus
}
#endif

View File

@@ -283,6 +283,10 @@ CGLM_EXPORT
void
glmc_vec4_sqrt(vec4 v, vec4 dest);
CGLM_EXPORT
void
glmc_vec4_make(float * __restrict src, vec4 dest);
#ifdef __cplusplus
}
#endif

View File

@@ -44,7 +44,7 @@
CGLM_INLINE mat4s glms_quat_rotate(mat4s m, versors q)
CGLM_INLINE mat4s glms_quat_rotate_at(mat4s m, versors q, vec3s pivot)
CGLM_INLINE mat4s glms_quat_rotate_atm(versors q, vec3s pivot)
CGLM_INLINE void glms_quat_make(float * restrict src)
CGLM_INLINE versors glms_quat_make(float * restrict src)
*/
#ifndef cglms_quat_h

View File

@@ -70,6 +70,7 @@
CGLM_INLINE vec3s glms_vec3_smoothinterp(vec3s from, vec3s to, float t);
CGLM_INLINE vec3s glms_vec3_smoothinterpc(vec3s from, vec3s to, float t);
CGLM_INLINE vec3s glms_vec3_swizzle(vec3s v, int mask);
CGLM_INLINE vec3s glms_vec3_make(float * restrict src);
Convenient:
CGLM_INLINE vec3s glms_cross(vec3s a, vec3s b);
@@ -967,4 +968,18 @@ glms_vec3_(swizzle)(vec3s v, int mask) {
return dest;
}
/*!
* @brief Create three dimensional vector from pointer
*
* @param[in] src pointer to an array of floats
* @returns constructed 3D vector from raw pointer
*/
CGLM_INLINE
vec3s
glms_vec3_(make)(float * __restrict src) {
vec3s dest;
glm_vec3_make(src, dest.raw);
return dest;
}
#endif /* cglms_vec3s_h */

View File

@@ -61,6 +61,7 @@
CGLM_INLINE vec4s glms_vec4_smoothinterpc(vec4s from, vec4s to, float t);
CGLM_INLINE vec4s glms_vec4_cubic(float s);
CGLM_INLINE vec4s glms_vec4_swizzle(vec4s v, int mask);
CGLM_INLINE vec4s glms_vec4_make(float * restrict src);
*/
#ifndef cglms_vec4s_h
@@ -811,4 +812,18 @@ glms_vec4_(swizzle)(vec4s v, int mask) {
return dest;
}
/*!
* @brief Create four dimensional vector from pointer
*
* @param[in] src pointer to an array of floats
* @returns constructed 4D vector from raw pointer
*/
CGLM_INLINE
vec4s
glms_vec4_(make)(float * __restrict src) {
vec4s dest;
glm_vec4_make(src, dest.raw);
return dest;
}
#endif /* cglms_vec4s_h */

View File

@@ -73,6 +73,7 @@
CGLM_INLINE void glm_vec3_smoothinterp(vec3 from, vec3 to, float t, vec3 dest);
CGLM_INLINE void glm_vec3_smoothinterpc(vec3 from, vec3 to, float t, vec3 dest);
CGLM_INLINE void glm_vec3_swizzle(vec3 v, int mask, vec3 dest);
CGLM_INLINE void glm_vec3_make(float * restrict src, vec3 dest);
Convenient:
CGLM_INLINE void glm_cross(vec3 a, vec3 b, vec3 d);
@@ -1079,4 +1080,18 @@ glm_normalize_to(vec3 v, vec3 dest) {
glm_vec3_normalize_to(v, dest);
}
/*!
* @brief Create three dimensional vector from pointer
*
* @param[in] src pointer to an array of floats
* @param[out] dest destination vector
*/
CGLM_INLINE
void
glm_vec3_make(float * __restrict src, vec3 dest) {
dest[0] = src[0];
dest[1] = src[1];
dest[2] = src[2];
}
#endif /* cglm_vec3_h */

View File

@@ -58,6 +58,7 @@
CGLM_INLINE void glm_vec4_smoothinterp(vec4 from, vec4 to, float t, vec4 dest);
CGLM_INLINE void glm_vec4_smoothinterpc(vec4 from, vec4 to, float t, vec4 dest);
CGLM_INLINE void glm_vec4_swizzle(vec4 v, int mask, vec4 dest);
CGLM_INLINE void glm_vec4_make(float * restrict src, vec4 dest);
DEPRECATED:
glm_vec4_dup
@@ -1133,4 +1134,17 @@ glm_vec4_swizzle(vec4 v, int mask, vec4 dest) {
glm_vec4_copy(t, dest);
}
/*!
* @brief Create four dimensional vector from pointer
*
* @param[in] src pointer to an array of floats
* @param[out] dest destination vector
*/
CGLM_INLINE
void
glm_vec4_make(float * __restrict src, vec4 dest) {
dest[0] = src[0]; dest[1] = src[1];
dest[2] = src[2]; dest[3] = src[3];
}
#endif /* cglm_vec4_h */