Blender  V3.3
Macros | Functions | Variables
easing.c File Reference
#include "BLI_math_base.h"
#include "BLI_easing.h"
#include "BLI_strict_flags.h"

Go to the source code of this file.

Macros

#define USE_ELASTIC_BLEND
 

Functions

float BLI_easing_back_ease_in (float time, float begin, float change, float duration, float overshoot)
 
float BLI_easing_back_ease_out (float time, float begin, float change, float duration, float overshoot)
 
float BLI_easing_back_ease_in_out (float time, float begin, float change, float duration, float overshoot)
 
float BLI_easing_bounce_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_bounce_ease_in_out (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_circ_ease_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_cubic_ease_in (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_cubic_ease_in_out (float time, float begin, float change, float duration)
 
static float elastic_blend (float time, float change, float duration, float amplitude, float s, float f)
 
float BLI_easing_elastic_ease_in (float time, float begin, float change, float duration, float amplitude, float period)
 
float BLI_easing_elastic_ease_out (float time, float begin, float change, float duration, float amplitude, float period)
 
float BLI_easing_elastic_ease_in_out (float time, float begin, float change, float duration, float amplitude, float period)
 
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_expo_ease_in_out (float time, float begin, float change, float duration)
 
float BLI_easing_linear_ease (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_quad_ease_in_out (float time, float begin, float change, float duration)
 
float BLI_easing_quart_ease_in (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_quart_ease_in_out (float time, float begin, float change, float duration)
 
float BLI_easing_quint_ease_in (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_quint_ease_in_out (float time, float begin, float change, float duration)
 
float BLI_easing_sine_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_sine_ease_in_out (float time, float begin, float change, float duration)
 

Variables

static const float pow_min = 0.0009765625f
 
static const float pow_scale = 1.0f / (1.0f - 0.0009765625f)
 

Macro Definition Documentation

◆ USE_ELASTIC_BLEND

#define USE_ELASTIC_BLEND

Definition at line 15 of file easing.c.

Function Documentation

◆ BLI_easing_back_ease_in()

float BLI_easing_back_ease_in ( float  time,
float  begin,
float  change,
float  duration,
float  overshoot 
)

Definition at line 17 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_back_ease_in_out()

float BLI_easing_back_ease_in_out ( float  time,
float  begin,
float  change,
float  duration,
float  overshoot 
)

Definition at line 31 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_back_ease_out()

float BLI_easing_back_ease_out ( float  time,
float  begin,
float  change,
float  duration,
float  overshoot 
)

Definition at line 24 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_bounce_ease_in()

float BLI_easing_bounce_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_bounce_ease_in_out()

float BLI_easing_bounce_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_bounce_ease_out()

float BLI_easing_bounce_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_circ_ease_in()

float BLI_easing_circ_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 74 of file easing.c.

References sqrtf, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_circ_ease_in_out()

float BLI_easing_circ_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 86 of file easing.c.

References sqrtf, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_circ_ease_out()

float BLI_easing_circ_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 80 of file easing.c.

References sqrtf, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_cubic_ease_in()

float BLI_easing_cubic_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 95 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_cubic_ease_in_out()

float BLI_easing_cubic_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_cubic_ease_out()

float BLI_easing_cubic_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 101 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_elastic_ease_in()

float BLI_easing_elastic_ease_in ( float  time,
float  begin,
float  change,
float  duration,
float  amplitude,
float  period 
)

◆ BLI_easing_elastic_ease_in_out()

float BLI_easing_elastic_ease_in_out ( float  time,
float  begin,
float  change,
float  duration,
float  amplitude,
float  period 
)

◆ BLI_easing_elastic_ease_out()

float BLI_easing_elastic_ease_out ( float  time,
float  begin,
float  change,
float  duration,
float  amplitude,
float  period 
)

◆ BLI_easing_expo_ease_in()

float BLI_easing_expo_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_expo_ease_in_out()

float BLI_easing_expo_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_expo_ease_out()

float BLI_easing_expo_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

◆ BLI_easing_linear_ease()

float BLI_easing_linear_ease ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 281 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate().

◆ BLI_easing_quad_ease_in()

float BLI_easing_quad_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 286 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quad_ease_in_out()

float BLI_easing_quad_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 298 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quad_ease_out()

float BLI_easing_quad_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 292 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quart_ease_in()

float BLI_easing_quart_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 307 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quart_ease_in_out()

float BLI_easing_quart_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 319 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quart_ease_out()

float BLI_easing_quart_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 313 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quint_ease_in()

float BLI_easing_quint_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 328 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quint_ease_in_out()

float BLI_easing_quint_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 338 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_quint_ease_out()

float BLI_easing_quint_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 333 of file easing.c.

References time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_sine_ease_in()

float BLI_easing_sine_ease_in ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 347 of file easing.c.

References cosf, M_PI_2, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_sine_ease_in_out()

float BLI_easing_sine_ease_in_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 357 of file easing.c.

References cosf, M_PI, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ BLI_easing_sine_ease_out()

float BLI_easing_sine_ease_out ( float  time,
float  begin,
float  change,
float  duration 
)

Definition at line 352 of file easing.c.

References M_PI_2, sinf, and time.

Referenced by fcurve_eval_keyframes_interpolate(), and gpencil_interpolate_seq_easing_calc().

◆ elastic_blend()

static float elastic_blend ( float  time,
float  change,
float  duration,
float  amplitude,
float  s,
float  f 
)
static

When the amplitude is less than the change, we need to blend f when we're close to the crossing point (int time), else we get an ugly sharp falloff.

Definition at line 121 of file easing.c.

References fabsf, l, t, and time.

Referenced by BLI_easing_elastic_ease_in(), BLI_easing_elastic_ease_in_out(), and BLI_easing_elastic_ease_out().

Variable Documentation

◆ pow_min

const float pow_min = 0.0009765625f
static

Definition at line 251 of file easing.c.

Referenced by BLI_easing_expo_ease_in(), and BLI_easing_expo_ease_out().

◆ pow_scale

const float pow_scale = 1.0f / (1.0f - 0.0009765625f)
static

Definition at line 252 of file easing.c.

Referenced by BLI_easing_expo_ease_in(), and BLI_easing_expo_ease_out().