diff --git a/include/bx/inline/math.inl b/include/bx/inline/math.inl index a24afd6..5677e59 100644 --- a/include/bx/inline/math.inl +++ b/include/bx/inline/math.inl @@ -492,6 +492,26 @@ namespace bx }; } + inline BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, const Vec3 _b) + { + return + { + _a.x / _b.x, + _a.y / _b.y, + _a.z / _b.z, + }; + } + + inline BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b) + { + return + { + _a.x / _b, + _a.y / _b, + _a.z / _b, + }; + } + inline BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c) { return add(mul(_a, _b), _c); diff --git a/include/bx/math.h b/include/bx/math.h index df08b87..4f3b7bb 100644 --- a/include/bx/math.h +++ b/include/bx/math.h @@ -327,6 +327,12 @@ namespace bx /// BX_CONSTEXPR_FUNC Vec3 mul(const Vec3 _a, float _b); + /// + BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, const Vec3 _b); + + /// + BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b); + /// BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c);