|
@@ -291,6 +291,11 @@ namespace bx
|
|
|
return _a * _b + _c;
|
|
return _a * _b + _c;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ inline BX_CONSTEXPR_FUNC float rcp(float _a)
|
|
|
|
|
+ {
|
|
|
|
|
+ return 1.0f / _a;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
inline BX_CONST_FUNC float mod(float _a, float _b)
|
|
inline BX_CONST_FUNC float mod(float _a, float _b)
|
|
|
{
|
|
{
|
|
|
return _a - _b * floor(_a / _b);
|
|
return _a - _b * floor(_a / _b);
|
|
@@ -494,22 +499,12 @@ namespace bx
|
|
|
|
|
|
|
|
inline BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, const Vec3 _b)
|
|
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,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ return mul(_a, rcp(_b) );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
inline BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b)
|
|
inline BX_CONSTEXPR_FUNC Vec3 div(const Vec3 _a, float _b)
|
|
|
{
|
|
{
|
|
|
- return
|
|
|
|
|
- {
|
|
|
|
|
- _a.x / _b,
|
|
|
|
|
- _a.y / _b,
|
|
|
|
|
- _a.z / _b,
|
|
|
|
|
- };
|
|
|
|
|
|
|
+ return mul(_a, rcp(_b) );
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
inline BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c)
|
|
inline BX_CONSTEXPR_FUNC Vec3 mad(const Vec3 _a, const float _b, const Vec3 _c)
|