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);