Added Vec3 mad.

This commit is contained in:
Branimir Karadžić
2018-11-14 08:17:56 -08:00
parent 13066c3474
commit e35f29b647
2 changed files with 8 additions and 0 deletions

View File

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

View File

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