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