Skip to content
Snippets Groups Projects
Commit 4e0860ca authored by Raphael Grimm's avatar Raphael Grimm
Browse files

Change scale_value_from_to to work with any number type

parent 41999d6d
No related branches found
No related tags found
No related merge requests found
......@@ -2,9 +2,10 @@
namespace simox::math
{
template <class T>
inline constexpr T
scale_value_from_to(T val, T from_lo, T from_hi, T to_lo, T to_hi)
inline constexpr auto
scale_value_from_to(auto val,
auto from_lo, auto from_hi,
auto to_lo, auto to_hi)
{
return to_lo + (val - from_lo) / (from_hi - from_lo) * (to_hi - to_lo);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment