mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
vec: convenient wrappers/utils for vectors (#21)
* vec: convenient wrappers/utils for vectors * add additional convenient funcs
This commit is contained in:
@@ -20,6 +20,7 @@
|
||||
GLM_VEC4_BLACK
|
||||
|
||||
Functions:
|
||||
CGLM_INLINE void glm_vec4(vec3 v3, float last, vec4 dest);
|
||||
CGLM_INLINE void glm_vec4_copy3(vec4 a, vec3 dest);
|
||||
CGLM_INLINE void glm_vec4_copy(vec4 v, vec4 dest);
|
||||
CGLM_INLINE float glm_vec4_dot(vec4 a, vec4 b);
|
||||
@@ -56,6 +57,22 @@
|
||||
#define GLM_VEC4_ONE (vec4)GLM_VEC4_ONE_INIT
|
||||
#define GLM_VEC4_BLACK (vec4)GLM_VEC4_BLACK_INIT
|
||||
|
||||
/*!
|
||||
* @brief init vec4 using vec3
|
||||
*
|
||||
* @param[in] v3 vector3
|
||||
* @param[in] last last item
|
||||
* @param[out] dest destination
|
||||
*/
|
||||
CGLM_INLINE
|
||||
void
|
||||
glm_vec4(vec3 v3, float last, vec4 dest) {
|
||||
dest[0] = v3[0];
|
||||
dest[1] = v3[1];
|
||||
dest[2] = v3[2];
|
||||
dest[3] = last;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief copy first 3 members of [a] to [dest]
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user