mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-08 12:31:51 +00:00
refactor Heightmap methods with templates
This commit is contained in:
parent
13b97f4398
commit
6e99461b5f
4 changed files with 82 additions and 141 deletions
33
src/util/functional_util.hpp
Normal file
33
src/util/functional_util.hpp
Normal 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);
|
||||
}
|
||||
};
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue