From 82bb83de0a326fca972fc281e53ba9e351087f7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 24 Nov 2015 08:46:18 -0800 Subject: [PATCH] Added vec3Min/Max/Rcp. --- include/bx/fpumath.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index 8d0e756..f05189c 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -235,6 +235,27 @@ namespace bx return len; } + inline void vec3Min(float* __restrict _result, const float* __restrict _a, const float* __restrict _b) + { + _result[0] = fmin(_a[0], _b[0]); + _result[1] = fmin(_a[1], _b[1]); + _result[2] = fmin(_a[2], _b[2]); + } + + inline void vec3Max(float* __restrict _result, const float* __restrict _a, const float* __restrict _b) + { + _result[0] = fmax(_a[0], _b[0]); + _result[1] = fmax(_a[1], _b[1]); + _result[2] = fmax(_a[2], _b[2]); + } + + inline void vec3Rcp(float* __restrict _result, const float* __restrict _a) + { + _result[0] = 1.0f / _a[0]; + _result[1] = 1.0f / _a[1]; + _result[2] = 1.0f / _a[2]; + } + inline void quatIdentity(float* _result) { _result[0] = 0.0f;