Utility::Value::Clamp
This commit is contained in:
parent
28fbcebf98
commit
2ec8662a83
|
@ -327,6 +327,10 @@ namespace Utility
|
|||
inline ValueType Min( const ValueType &valueA, const ValueType &valueB )
|
||||
{ return valueA < valueB ? valueA : valueB; }
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType Clamp( const ValueType &value, const ValueType &min, const ValueType &max )
|
||||
{ return value < min ? Max( value, max ) : min; }
|
||||
|
||||
template<typename ValueType>
|
||||
inline ValueType Average( const ValueType &valueA, const ValueType &valueB )
|
||||
{ return (valueA + valueB) * 0.5f; }
|
||||
|
|
Loading…
Reference in New Issue