refactor Heightmap methods with templates

This commit is contained in:
MihailRis
2024-08-13 22:00:16 +03:00
parent 13b97f4398
commit 6e99461b5f
4 changed files with 82 additions and 141 deletions
+33
View File
@@ -0,0 +1,33 @@
#pragma once
#include <glm/glm.hpp>
namespace util {
template<class T>
struct pow {
constexpr T operator()(T a, T b) const {
return glm::pow(a, b);
}
};
template<class T>
struct min {
constexpr T operator()(T a, T b) const {
return glm::min(a, b);
}
};
template<class T>
struct max {
constexpr T operator()(T a, T b) const {
return glm::max(a, b);
}
};
template<class T>
struct abs {
constexpr T operator()(T a) const {
return glm::abs(a);
}
};
}