From d54a0534f8ad2377e843d1a3cf8cc3936ddb7e7b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Tue, 24 Nov 2015 20:57:22 -0800 Subject: [PATCH] Added vec3Add/Sub. --- include/bx/fpumath.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index f05189c..5a66360 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -173,6 +173,13 @@ namespace bx _result[2] = _a[2] + _b[2]; } + inline void vec3Add(float* __restrict _result, const float* __restrict _a, float _b) + { + _result[0] = _a[0] + _b; + _result[1] = _a[1] + _b; + _result[2] = _a[2] + _b; + } + inline void vec3Sub(float* __restrict _result, const float* __restrict _a, const float* __restrict _b) { _result[0] = _a[0] - _b[0]; @@ -180,6 +187,13 @@ namespace bx _result[2] = _a[2] - _b[2]; } + inline void vec3Sub(float* __restrict _result, const float* __restrict _a, float _b) + { + _result[0] = _a[0] - _b; + _result[1] = _a[1] - _b; + _result[2] = _a[2] - _b; + } + inline void vec3Mul(float* __restrict _result, const float* __restrict _a, const float* __restrict _b) { _result[0] = _a[0] * _b[0];