mirror of
https://github.com/recp/cglm.git
synced 2026-02-17 03:39:05 +00:00
vec2: add new function glm_vec2_make
Just a copy of glm_vec2, but with the word _make suffixed at the end. Function takes in a float array array must be at least of size 2 and converts it into a 2D vector. Signed-off-by: Vincent Davis Jr <vince@underview.tech>
This commit is contained in:
@@ -46,6 +46,7 @@
|
||||
CGLM_INLINE vec2s glms_vec2_minv(vec2s a, vec2s b)
|
||||
CGLM_INLINE vec2s glms_vec2_clamp(vec2s v, float minVal, float maxVal)
|
||||
CGLM_INLINE vec2s glms_vec2_lerp(vec2s from, vec2s to, float t)
|
||||
CGLM_INLINE vec2s glms_vec2_make(float * restrict src)
|
||||
*/
|
||||
|
||||
#ifndef cglms_vec2s_h
|
||||
@@ -558,4 +559,18 @@ glms_vec2_(lerp)(vec2s from, vec2s to, float t) {
|
||||
return r;
|
||||
}
|
||||
|
||||
/*!
|
||||
* @brief Create two dimensional vector from pointer
|
||||
*
|
||||
* @param[in] src pointer to an array of floats
|
||||
* @returns constructed 2D vector from raw pointer
|
||||
*/
|
||||
CGLM_INLINE
|
||||
vec2s
|
||||
glms_vec2_(make)(float * __restrict src) {
|
||||
vec2s dest;
|
||||
glm_vec2_make(src, dest.raw);
|
||||
return dest;
|
||||
}
|
||||
|
||||
#endif /* cglms_vec2s_h */
|
||||
|
||||
Reference in New Issue
Block a user