16#define USE_ELASTIC_BLEND
19 float time,
float begin,
float change,
float duration,
float overshoot)
26 float time,
float begin,
float change,
float duration,
float overshoot)
33 float time,
float begin,
float change,
float duration,
float overshoot)
36 if ((
time /= duration / 2) < 1.0f) {
40 return change / 2 * (
time *
time * ((overshoot + 1) *
time + overshoot) + 2) +
begin;
46 if (
time < (1 / 2.75f)) {
49 if (
time < (2 / 2.75f)) {
50 time -= (1.5f / 2.75f);
53 if (
time < (2.5f / 2.75f)) {
54 time -= (2.25f / 2.75f);
57 time -= (2.625f / 2.75f);
58 return change * ((7.5625f *
time) *
time + 0.984375f) +
begin;
68 if (
time < duration / 2) {
72 change * 0.5f +
begin;
89 if ((
time /= duration / 2) < 1.0f) {
110 if ((
time /= duration / 2) < 1.0f) {
117#ifdef USE_ELASTIC_BLEND
123 float time,
float change,
float duration,
float amplitude,
float s,
float f)
128 const float t =
fabsf(s);
130 f *= amplitude /
fabsf(change);
138 f = (f *
l) + (1.0f -
l);
147 float time,
float begin,
float change,
float duration,
float amplitude,
float period)
156 if ((
time /= duration) == 1.0f) {
157 return begin + change;
161 period = duration * 0.3f;
163 if (!amplitude || amplitude <
fabsf(change)) {
165#ifdef USE_ELASTIC_BLEND
171 s = period / (2 * float(
M_PI)) *
asinf(change / amplitude);
174 return (-f * (amplitude *
powf(2, 10 *
time) *
175 sinf((
time * duration - s) * (2 *
float(
M_PI)) / period))) +
180 float time,
float begin,
float change,
float duration,
float amplitude,
float period)
188 if ((
time /= duration) == 1.0f) {
189 return begin + change;
193 period = duration * 0.3f;
195 if (!amplitude || amplitude <
fabsf(change)) {
197#ifdef USE_ELASTIC_BLEND
203 s = period / (2 * float(
M_PI)) *
asinf(change / amplitude);
206 return (f * (amplitude *
powf(2, 10 *
time) *
207 sinf((
time * duration - s) * (2 *
float(
M_PI)) / period))) +
212 float time,
float begin,
float change,
float duration,
float amplitude,
float period)
220 if ((
time /= duration / 2) == 2.0f) {
221 return begin + change;
225 period = duration * (0.3f * 1.5f);
227 if (!amplitude || amplitude <
fabsf(change)) {
229#ifdef USE_ELASTIC_BLEND
235 s = period / (2 * float(
M_PI)) *
asinf(change / amplitude);
240 return (f * (amplitude *
powf(2, 10 *
time) *
241 sinf((
time * duration - s) * (2 *
float(
M_PI)) / period))) +
247 return (f * (amplitude *
powf(2, 10 *
time) *
248 sinf((
time * duration - s) * (2 *
float(
M_PI)) / period))) +
253static const float pow_scale = 1.0f / (1.0f - 0.0009765625f);
273 float duration_half = duration / 2.0f;
274 float change_half = change / 2.0f;
275 if (
time <= duration_half) {
279 time - duration_half,
begin + change_half, change_half, duration_half);
301 if ((
time /= duration / 2) < 1.0f) {
322 if ((
time /= duration / 2) < 1.0f) {
341 if ((
time /= duration / 2) < 1.0f) {
ATTR_WARN_UNUSED_RESULT const BMLoop * l
float BLI_easing_sine_ease_in(float time, float begin, float change, float duration)
float BLI_easing_back_ease_out(float time, float begin, float change, float duration, float overshoot)
float BLI_easing_linear_ease(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_quint_ease_out(float time, float begin, float change, float duration)
float BLI_easing_quart_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_quart_ease_out(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_in(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_in(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_in(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_out(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_in(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_quad_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_out(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_cubic_ease_in(float time, float begin, float change, float duration)
float BLI_easing_elastic_ease_in_out(float time, float begin, float change, float duration, float amplitude, float period)
float BLI_easing_quint_ease_in(float time, float begin, float change, float duration)
float BLI_easing_sine_ease_out(float time, float begin, float change, float duration)
float BLI_easing_bounce_ease_out(float time, float begin, float change, float duration)
float BLI_easing_quad_ease_in(float time, float begin, float change, float duration)
float BLI_easing_quad_ease_out(float time, float begin, float change, float duration)
float BLI_easing_circ_ease_out(float time, float begin, float change, float duration)
float BLI_easing_cubic_ease_out(float time, float begin, float change, float duration)
float BLI_easing_back_ease_in(float time, float begin, float change, float duration, float overshoot)
static float elastic_blend(float time, float change, float duration, float amplitude, float s, float f)
float BLI_easing_quint_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_expo_ease_in_out(float time, float begin, float change, float duration)
static const float pow_min
float BLI_easing_quart_ease_in(float time, float begin, float change, float duration)
static const float pow_scale
float BLI_easing_back_ease_in_out(float time, float begin, float change, float duration, float overshoot)
float BLI_easing_cubic_ease_in_out(float time, float begin, float change, float duration)
float BLI_easing_sine_ease_in_out(float time, float begin, float change, float duration)