Curves
Categories:
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
| Family | Functions | Character |
|---|---|---|
| Linear | Linear | Constant speed |
| Quadratic | EaseInQuadratic, EaseOutQuadratic, EaseInOutQuadratic | Gentle acceleration |
| Cubic | EaseInCubic, EaseOutCubic, EaseInOutCubic | Moderate acceleration |
| Quartic | EaseInQuartic, EaseOutQuartic, EaseInOutQuartic | Strong acceleration |
| Quintic | EaseInQuintic, EaseOutQuintic, EaseInOutQuintic | Very strong acceleration |
| Sine | EaseInSine, EaseOutSine, EaseInOutSine | Gentle, natural feel |
| Exponential | EaseInExpo, EaseOutExpo, EaseInOutExpo | Dramatic speed change |
| Circular | EaseInCirc, EaseOutCirc, EaseInOutCirc | Quarter-circle shape |
| Back | EaseInBack, EaseOutBack, EaseInOutBack | Overshoot and return |
| Elastic | EaseInElastic, EaseOutElastic, EaseInOutElastic | Spring-like oscillation |
| Bounce | EaseInBounce, EaseOutBounce, EaseInOutBounce | Bouncing 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:
| Function | Description |
|---|---|
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:
- Common Enums —
CurveTypeenum for data-driven curve selection - Springs Utility
- Gradients
- Core Utilities
Get GS_Core
GS_Core — Explore this gem on the product page and add it to your project.