From 1bfd5ed0cdf09f88b24cd4160b46983757bbecc7 Mon Sep 17 00:00:00 2001 From: Jan Schmidt Date: Mon, 7 Aug 2023 02:31:50 +1000 Subject: [PATCH] a/math: Add m_vec3_inverse() Part-of: --- src/xrt/auxiliary/math/m_vec3.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xrt/auxiliary/math/m_vec3.h b/src/xrt/auxiliary/math/m_vec3.h index df4620dbd..cb3df47f7 100644 --- a/src/xrt/auxiliary/math/m_vec3.h +++ b/src/xrt/auxiliary/math/m_vec3.h @@ -67,6 +67,13 @@ m_vec3_div_scalar(struct xrt_vec3 l, float r) return ret; } +static inline struct xrt_vec3 +m_vec3_inverse(struct xrt_vec3 v) +{ + struct xrt_vec3 ret = {-v.x, -v.y, -v.z}; + return ret; +} + static inline float m_vec3_dot(struct xrt_vec3 l, struct xrt_vec3 r) {