diff --git a/libs/geom/include/psemek/geom/math.hpp b/libs/geom/include/psemek/geom/math.hpp index 8e3d832d..21066c2b 100644 --- a/libs/geom/include/psemek/geom/math.hpp +++ b/libs/geom/include/psemek/geom/math.hpp @@ -196,6 +196,17 @@ namespace psemek::geom return false; } + template + bool compare_swap(T & min, T & max) + { + if (min > max) + { + std::swap(min, max); + return true; + } + return false; + } + template T smoothstep(T x) {