mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Added invSmoothStep.
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user