From 289914931dee841971be18391ff64d7b6b3ef96c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Sun, 22 Nov 2015 22:24:17 -0800 Subject: [PATCH] Added vec3Lerp. --- include/bx/fpumath.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/include/bx/fpumath.h b/include/bx/fpumath.h index 0aa92c8..8d0e756 100644 --- a/include/bx/fpumath.h +++ b/include/bx/fpumath.h @@ -89,6 +89,11 @@ namespace bx return fabsf(_a); } + inline float fsq(float _a) + { + return _a * _a; + } + inline float fsqrt(float _a) { return sqrtf(_a); @@ -206,6 +211,20 @@ namespace bx return fsqrt(vec3Dot(_a, _a) ); } + inline void vec3Lerp(float* __restrict _result, const float* __restrict _a, const float* __restrict _b, float _t) + { + _result[0] = flerp(_a[0], _b[0], _t); + _result[1] = flerp(_a[1], _b[1], _t); + _result[2] = flerp(_a[2], _b[2], _t); + } + + inline void vec3Lerp(float* __restrict _result, const float* __restrict _a, const float* __restrict _b, const float* __restrict _c) + { + _result[0] = flerp(_a[0], _b[0], _c[0]); + _result[1] = flerp(_a[1], _b[1], _c[1]); + _result[2] = flerp(_a[2], _b[2], _c[2]); + } + inline float vec3Norm(float* __restrict _result, const float* __restrict _a) { const float len = vec3Length(_a);