Tweeny 4.1.0
A Tweening library for modern C++
Loading...
Searching...
No Matches

◆ cubicIn

detail::cubicInEasing cubicIn {}
inlineconstexpr

Cubic polynomial easing (t³) with moderate acceleration.

The cubicIn easing function uses a cubic power curve for acceleration, providing smooth, noticeable easing that's more pronounced than quadratic but less extreme than quartic or exponential.

Characteristics:

  • Polynomial acceleration with power of 3
  • Balanced between gentle and dramatic
  • Widely used and well-understood
  • Good default for many animation types

This easing is ideal for:

  • Standard UI animations: Menus, panels, overlays
  • Easing beginners: Easy to understand and predict
  • General-purpose acceleration: Versatile for many contexts
  • Medium-length animations: 200-500ms durations

CubicIn is a popular choice because it provides clear easing without being subtle (like quadratic) or extreme (like quartic/exponential).

Mathematically: f(t) = t³

// Dropdown menu opening
auto height = tweeny::from(0.0f)
.to(200.0f)
.during(30U)
.build();
tweeny_builder< true, FirstValue, RemainingValues... > to(const FirstValue &firstComponent, const RemainingValues &... remainingComponents) &
Adds a target keyframe to the tween.
Definition tweeny.h:109
tweeny_builder & via(EasingFunctionTypes... easing_functions)
Specifies per-component easing functions for the last keyframe segment.
Definition tweeny.h:198
constexpr detail::cubicInEasing cubicIn
Cubic polynomial easing (t³) with moderate acceleration.
Definition easing.h:457
tweeny_builder< false, FirstValue, RemainingValues... > from(FirstValue firstComponent, RemainingValues... remainingComponents)
Creates a new tween builder starting from the specified value(s).
Definition tweeny.h:347
See also
cubicOut For cubic deceleration
cubicInOut For cubic motion at both ends
quadraticIn For gentler acceleration
quarticIn For stronger acceleration
Visualize at https://easings.net/#easeInCubic