Add geom::compare_swap utility function
This commit is contained in:
parent
d09bd76a14
commit
540d63ce5b
1 changed files with 11 additions and 0 deletions
|
|
@ -196,6 +196,17 @@ namespace psemek::geom
|
|||
return false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool compare_swap(T & min, T & max)
|
||||
{
|
||||
if (min > max)
|
||||
{
|
||||
std::swap(min, max);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T smoothstep(T x)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue