ASW Lib
A.D.S. Games SDL Wrapper Library. A library targeted at Allegro4 users who want to switch to SDL3 and use modern c++.
Loading...
Searching...
No Matches
easing.h File Reference

Easing functions for animations. More...

#include <algorithm>
#include <concepts>
#include <functional>
#include <limits>
#include <type_traits>
#include "./types.h"
Include dependency graph for easing.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Namespaces

namespace  asw
 
namespace  asw::easing
 
namespace  asw::easing::detail
 

Functions

template<typename T >
T asw::easing::detail::mix (const T &a, const T &b, float f)
 a + (b - a) * f. Integer types are worked in floating point, so a falling unsigned range does not wrap, and a result past the range of T, e.g. from an overshooting easing, is clamped to it.
 
float asw::easing::linear (float t)
 
float asw::easing::smoothstep (float t)
 Soft at both ends, 3t^2 - 2t^3.
 
float asw::easing::ease_in_quad (float t)
 
float asw::easing::ease_out_quad (float t)
 
float asw::easing::ease_in_out_quad (float t)
 
float asw::easing::ease_in_cubic (float t)
 
float asw::easing::ease_out_cubic (float t)
 
float asw::easing::ease_in_out_cubic (float t)
 
float asw::easing::ease_in_sine (float t)
 
float asw::easing::ease_out_sine (float t)
 
float asw::easing::ease_in_out_sine (float t)
 
float asw::easing::ease_in_expo (float t)
 
float asw::easing::ease_out_expo (float t)
 
float asw::easing::ease_in_out_expo (float t)
 
float asw::easing::ease_in_elastic (float t)
 
float asw::easing::ease_out_elastic (float t)
 
float asw::easing::ease_in_bounce (float t)
 
float asw::easing::ease_out_bounce (float t)
 
float asw::easing::ease_in_back (float t)
 
float asw::easing::ease_out_back (float t)
 
float asw::easing::falloff (float t, asw::Falloff mode)
 
template<typename T , typename Func >
T asw::easing::ease (const T &a, const T &b, float t, Func func)
 

Detailed Description

Easing functions for animations.

Author
Allan Legemaate (alege.nosp@m.maat.nosp@m.e@gma.nosp@m.il.c.nosp@m.om)
Date
2026-02-13

Definition in file easing.h.