mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Added Vec3 version of nms.
This commit is contained in:
@@ -592,6 +592,16 @@ namespace bx
|
||||
return mul(_a, rcp(_b) );
|
||||
}
|
||||
|
||||
inline BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const float _b, const Vec3 _c)
|
||||
{
|
||||
return sub(_c, mul(_a, _b) );
|
||||
}
|
||||
|
||||
inline BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const Vec3 _b, const Vec3 _c)
|
||||
{
|
||||
return sub(_c, mul(_a, _b) );
|
||||
}
|
||||
|
||||
inline BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c)
|
||||
{
|
||||
return add(mul(_a, _b), _c);
|
||||
|
||||
@@ -304,7 +304,7 @@ namespace bx
|
||||
///
|
||||
BX_CONSTEXPR_FUNC float fract(float _a);
|
||||
|
||||
/// Returns result of negated multiply-sub operation -(_a * _b - _c).
|
||||
/// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
|
||||
///
|
||||
BX_CONSTEXPR_FUNC float nms(float _a, float _b, float _c);
|
||||
|
||||
@@ -407,6 +407,14 @@ namespace bx
|
||||
///
|
||||
BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b);
|
||||
|
||||
/// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
|
||||
///
|
||||
BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const float _b, const Vec3 _c);
|
||||
|
||||
/// Returns result of negated multiply-sub operation -(_a * _b - _c) -> _c - _a * _b.
|
||||
///
|
||||
BX_CONSTEXPR_FUNC Vec3 nms(const Vec3 _a, const Vec3 _b, const Vec3 _c);
|
||||
|
||||
///
|
||||
BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user