The open source OpenXR runtime
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

aux/math: Add vec2 squared length function

+17 -1
+17 -1
src/xrt/auxiliary/math/m_vec2.h
··· 21 21 #endif 22 22 23 23 24 + /*! 25 + * @ingroup aux_math 26 + * @{ 27 + */ 28 + 24 29 static inline struct xrt_vec2 25 30 m_vec2_mul(struct xrt_vec2 l, struct xrt_vec2 r) 26 31 { ··· 64 69 } 65 70 66 71 static inline float 72 + m_vec2_len_sqrd(struct xrt_vec2 l) 73 + { 74 + return l.x * l.x + l.y * l.y; 75 + } 76 + 77 + 78 + static inline float 67 79 m_vec2_len(struct xrt_vec2 l) 68 80 { 69 - return sqrtf(l.x * l.x + l.y * l.y); 81 + return sqrtf(m_vec2_len_sqrd(l)); 70 82 } 83 + 84 + /*! 85 + * @} 86 + */ 71 87 72 88 73 89 #ifdef __cplusplus