From 66d8e8066ab53690d79831fb126eb9940afce8d3 Mon Sep 17 00:00:00 2001 From: Jakob Bornecrantz Date: Mon, 14 Aug 2023 15:05:23 +0100 Subject: [PATCH] m/vec2: Add float array helper --- src/xrt/auxiliary/math/m_vec2.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/xrt/auxiliary/math/m_vec2.h b/src/xrt/auxiliary/math/m_vec2.h index 32b76e010..fe8cf3dad 100644 --- a/src/xrt/auxiliary/math/m_vec2.h +++ b/src/xrt/auxiliary/math/m_vec2.h @@ -109,6 +109,15 @@ m_vec2_lerp(struct xrt_vec2 from, struct xrt_vec2 to, float amount) return m_vec2_add(m_vec2_mul_scalar(from, 1.0f - amount), m_vec2_mul_scalar(to, amount)); } +typedef float m_vec2_float_arr[2]; + +static inline m_vec2_float_arr * +m_vec2_ptr_to_float_arr_ptr(struct xrt_vec2 *ptr) +{ + return (m_vec2_float_arr *)ptr; +} + + #ifdef __cplusplus }