Curves

40+ easing curve functions for smooth animation and interpolation — organized by family with a CurveType enum for data-driven selection.

The Curves namespace (GS_Core::Curves) provides 40+ easing functions for smooth animation and interpolation. All functions take a normalized t value in [0,1] and return a remapped [0,1] value. The dispatch function EvaluateCurve routes to the correct function by CurveType enum value, making curve selection fully data-driven from the Inspector or asset editor.

Used by every GS_Motion track, all gradient evaluate calls, and the blend profile system.

For usage guides and setup examples, see The Basics: GS_Core.

 

Contents


Curve Families

FamilyFunctionsCharacter
LinearLinearConstant speed
QuadraticEaseInQuadratic, EaseOutQuadratic, EaseInOutQuadraticGentle acceleration
CubicEaseInCubic, EaseOutCubic, EaseInOutCubicModerate acceleration
QuarticEaseInQuartic, EaseOutQuartic, EaseInOutQuarticStrong acceleration
QuinticEaseInQuintic, EaseOutQuintic, EaseInOutQuinticVery strong acceleration
SineEaseInSine, EaseOutSine, EaseInOutSineGentle, natural feel
ExponentialEaseInExpo, EaseOutExpo, EaseInOutExpoDramatic speed change
CircularEaseInCirc, EaseOutCirc, EaseInOutCircQuarter-circle shape
BackEaseInBack, EaseOutBack, EaseInOutBackOvershoot and return
ElasticEaseInElastic, EaseOutElastic, EaseInOutElasticSpring-like oscillation
BounceEaseInBounce, EaseOutBounce, EaseInOutBounceBouncing ball effect

Variant naming: EaseIn = slow start, EaseOut = slow end, EaseInOut = slow start and end.


API Reference

Dispatch Function

float EvaluateCurve(CurveType curveType, float t);

Dispatches to the correct curve function based on the CurveType enum value. This is the primary call site for all motion and gradient systems. t must be in [0,1].

Individual Functions

One free function per CurveType value, all sharing the signature float <Name>(float t). Examples:

FunctionDescription
GS_Core::Curves::Linear(t)Linear — no easing
GS_Core::Curves::EaseInQuadratic(t)Quadratic ease-in
GS_Core::Curves::EaseOutBounce(t)Bounce ease-out
GS_Core::Curves::EaseInOutBack(t)Back ease-in-out (overshoot both ends)

All functions follow the same naming pattern as the CurveType enum values.


Usage Examples

Dispatch via enum (data-driven)

#include <GS_Core/Utility/Math/CurvesUtility.h>

// Evaluate at normalized progress t (0 → 1)
float eased = GS_Core::Curves::EvaluateCurve(GS_Core::CurveType::EaseInOutCubic, t);

// Interpolate between two values
float result = start + (end - start) * GS_Core::Curves::EvaluateCurve(curveType, t);

Direct function call

// Call the function directly for a known curve
float eased = GS_Core::Curves::EaseOutBack(t);

See Also

For related resources:


Get GS_Core

GS_Core — Explore this gem on the product page and add it to your project.