mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
vec3: add new function glm_vec3_make
Function takes in a float array. Array must be at least of size 3 and converts it into a 3D vector. Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This commit is contained in:
@@ -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 */
|
||||
|
||||
Reference in New Issue
Block a user