mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2025-02-17 20:31:57 -05:00
Added fclamp and fsaturate.
This commit is contained in:
parent
6c4faed7d5
commit
b36a26528a
1 changed files with 10 additions and 0 deletions
|
@ -22,6 +22,16 @@ inline float fmax(float _a, float _b)
|
|||
return _a > _b ? _a : _b;
|
||||
}
|
||||
|
||||
inline float fclamp(float _a, float _min, float _max)
|
||||
{
|
||||
return fmin(fmax(_a, _min), _max);
|
||||
}
|
||||
|
||||
inline float fsaturate(float _a)
|
||||
{
|
||||
return fclamp(_a, 0.0f, 1.0f);
|
||||
}
|
||||
|
||||
inline float flerp(float _a, float _b, float _t)
|
||||
{
|
||||
return _a + (_b - _a) * _t;
|
||||
|
|
Loading…
Reference in a new issue