Skip to content

High-degree easing functions shouldn't be jerky #16678

Open
@scottmcm

Description

@scottmcm

Bevy version

#[inline]
pub(crate) fn quintic_in_out(t: f32) -> f32 {
if t < 0.5 {
16.0 * t * t * t * t * t
} else {
1.0 - (-2.0 * t + 2.0)
* (-2.0 * t + 2.0)
* (-2.0 * t + 2.0)
* (-2.0 * t + 2.0)
* (-2.0 * t + 2.0)
/ 2.0
}
}

What you did

Low-degree easing functions have no choice to be jerky -- a quadratic one is forced to be jerky because it doesn't have enough degrees of freedom not to be.

If I'm using QuinticInOut, though, I'd expect it to be using those extra degrees to give continuous acceleration.

The current definition is still jerky, though: it jumps from +40 acceleration to -40 acceleration instantly: https://www.desmos.com/calculator/vrnk8cfacz

Or if the existing ones shouldn't be edited, for some reason, should maybe some Hermite in-out easing functions be added with 0 nth derivates at the endpoints?

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-AnimationMake things move and change over timeA-MathFundamental domain-agnostic mathematical operationsC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions