4 #include <glm/common.hpp>
10 std::chrono::system_clock::time_point last_time;
13 : friction{ _friction }
19 auto now = std::chrono::system_clock::now();
20 float time = std::chrono::duration_cast<std::chrono::milliseconds>(now - last_time).count();
22 time *= (1.f / friction);
23 time = glm::min(time, 1.f);
25 T distance = target - current;
26 T step = distance * time;
29 return current + step;
constexpr T move_towards(T current, T target)
constexpr ValueChase(float _friction) noexcept