From e35f29b6479d4b17bb0ca626905f0b2c76c63d6d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Branimir=20Karad=C5=BEi=C4=87?= Date: Wed, 14 Nov 2018 08:17:56 -0800 Subject: [PATCH] Added Vec3 mad. --- include/bx/inline/math.inl | 5 +++++ include/bx/math.h | 3 +++ 2 files changed, 8 insertions(+) diff --git a/include/bx/inline/math.inl b/include/bx/inline/math.inl index 16c7e8c..f586ea7 100644 --- a/include/bx/inline/math.inl +++ b/include/bx/inline/math.inl @@ -404,6 +404,11 @@ namespace bx }; } + inline constexpr BX_CONST_FUNC Vec3 mad(const Vec3& _a, const Vec3& _b, const Vec3& _c) + { + return add(mul(_a, _b), _c); + } + inline constexpr BX_CONST_FUNC float dot(const Vec3& _a, const Vec3& _b) { return _a.x*_b.x + _a.y*_b.y + _a.z*_b.z; diff --git a/include/bx/math.h b/include/bx/math.h index 568c092..de73d53 100644 --- a/include/bx/math.h +++ b/include/bx/math.h @@ -291,6 +291,9 @@ namespace bx /// constexpr BX_CONST_FUNC Vec3 mul(const Vec3& _a, float _b); + /// + constexpr BX_CONST_FUNC Vec3 mad(const Vec3& _a, const Vec3& _b, const Vec3& _c); + /// constexpr BX_CONST_FUNC float dot(const Vec3& _a, const Vec3& _b);