Added invSmoothStep.

This commit is contained in:
Бранимир Караџић
2020-12-20 11:06:55 -08:00
parent 7837d90865
commit 279b8ff3c0
2 changed files with 8 additions and 0 deletions

View File

@@ -344,6 +344,11 @@ namespace bx
return square(_a)*(3.0f - 2.0f*_a);
}
inline BX_CONST_FUNC float invSmoothStep(float _a)
{
return 0.5f - sin(asin(1.0f - 2.0f * _a) / 3.0f);
}
inline BX_CONSTEXPR_FUNC float bias(float _time, float _bias)
{
return _time / ( ( (1.0f/_bias - 2.0f)*(1.0f - _time) ) + 1.0f);

View File

@@ -282,6 +282,9 @@ namespace bx
///
BX_CONSTEXPR_FUNC float smoothStep(float _a);
///
BX_CONST_FUNC float invSmoothStep(float _a);
///
BX_CONSTEXPR_FUNC float bias(float _time, float _bias);