29 return x *
x * ( 3 - 2 *
x );
42 animated( T def, std::chrono::system_clock::duration duration = std::chrono::milliseconds( 200 ) )
63 auto ms = std::chrono::duration_cast< std::chrono::microseconds >(
now -
_last_update ).count();
64 auto duration_ms = std::chrono::duration_cast< std::chrono::microseconds >(
_duration ).count();
65 auto t = (float)ms / duration_ms;
67 return static_cast< T
>(
_old * ( 1.f -
t ) +
_new *
t );
69 operator T()
const {
return get(); }