FCurve User Class.
More...
#include <FCurve.h>
|
| enum class | SpanInterpolationMethod : uint8_t { Constant
, Linear
, Curve
} |
| |
| enum class | CurveInterpolationMethod : uint8_t {
Bezier
, Hermite
, Sine
, Parabolic
,
TangentLog
} |
| |
| enum class | ExtrapolationMode {
Constant
, Linear
, Cycle
, RelativeRepeat
,
Oscillate
} |
| |
| using | FCurvePoints = Amino::Array< SegmentPoint > |
| |
|
| static double | evaluateCurveSegment (CurveInterpolationMethod interpolation, double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double x) |
| | Support function to evaluate a cubic curve segment. More...
|
| |
| static double | evalBezier (double x0, double y0, double x1, double y1, double x2, double y2, double x3, double y3, double x) |
| | Short-hand for evaluateCurveSegment with Bezier interpolation. More...
|
| |
FCurve User Class.
Definition at line 45 of file FCurve.h.
◆ FCurvePoints
◆ CurveInterpolationMethod
Defines interpolation function within curve segments for non-rotation curves
| Enumerator |
|---|
| Bezier | Bezier.
|
| Hermite | Hermite.
|
| Sine | Sine.
|
| Parabolic | Parabolic.
|
| TangentLog | Log.
|
Definition at line 62 of file FCurve.h.
◆ ExtrapolationMode
Curve extrapolation mode supported for pre/post extrapolation Note: this enum values are use to do serialization/deserialization
| Enumerator |
|---|
| Constant | Flat line.
|
| Linear | Continue the linear trend in linear interpolation.
|
| Cycle | Cycle the curve. (abc -> abc abc abc...)
|
| RelativeRepeat | Offsets the value of the first point to the value of the last point each cycle.
|
| Oscillate | Mirror the curve on X, and then cycle the mirrored the result. (abc -> abc cba abc cba...)
|
Definition at line 72 of file FCurve.h.
◆ SpanInterpolationMethod
Defines span interpolation method determined by the tangents of boundary keys
| Enumerator |
|---|
| Constant | Constant.
|
| Linear | Linear.
|
| Curve | Bezier/Hermite/...
|
Definition at line 54 of file FCurve.h.
◆ FCurve() [1/2]
| Bifrost::Math::FCurve::FCurve |
( |
bool |
createDefaultValue = true | ) |
|
|
explicit |
Constructor.
param [in] createDefaultValue True will create a default curve y=x; numPoints() > 0. False will evaluate as y=x; numPoints() == 0.
◆ ~FCurve()
| Bifrost::Math::FCurve::~FCurve |
( |
| ) |
|
◆ FCurve() [2/2]
| Bifrost::Math::FCurve::FCurve |
( |
FCurve const & |
other | ) |
|
Copy constructor.
- Parameters
-
◆ defaultValue()
| bool Bifrost::Math::FCurve::defaultValue |
( |
| ) |
|
Reset to a default FCurve.
The default FCurve is y=x.
- Returns
- True if reset is successful, else false.
◆ evalBezier()
| static double Bifrost::Math::FCurve::evalBezier |
( |
double |
x0, |
|
|
double |
y0, |
|
|
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x3, |
|
|
double |
y3, |
|
|
double |
x |
|
) |
| |
|
inlinestatic |
Short-hand for evaluateCurveSegment with Bezier interpolation.
Definition at line 227 of file FCurve.h.
◆ evalFCurve()
| double Bifrost::Math::FCurve::evalFCurve |
( |
double |
x | ) |
const |
Evaluate the FCurve at the given x value.
- Parameters
-
| [in] | x | The x value at which the FCurve will be evaluated |
- Returns
- The value of the FCurve at x.
◆ evaluateCurveSegment()
| static double Bifrost::Math::FCurve::evaluateCurveSegment |
( |
CurveInterpolationMethod |
interpolation, |
|
|
double |
x0, |
|
|
double |
y0, |
|
|
double |
x1, |
|
|
double |
y1, |
|
|
double |
x2, |
|
|
double |
y2, |
|
|
double |
x3, |
|
|
double |
y3, |
|
|
double |
x |
|
) |
| |
|
static |
Support function to evaluate a cubic curve segment.
- Parameters
-
| interpolation | The desired curve interpolation method |
| x0 | The x coordinate of 0th control point |
| y0 | The y coordinate of 0th control point |
| x1 | The x coordinate of 1st control point |
| y1 | The y coordinate of 1st control point |
| x2 | The x coordinate of 2nd control point |
| y2 | The y coordinate of 2nd control point |
| x3 | The x coordinate of 3rd control point |
| y3 | The y coordinate of 3rd control point |
| x | The x coordinate at which to evaluate the curve segment |
- Returns
- The value of the curve at x, given the 4 control points
◆ getPoints()
| FCurvePoints const & Bifrost::Math::FCurve::getPoints |
( |
| ) |
const |
|
inline |
◆ getPostExtrapolation()
Get the post-extrapolation mode.
Definition at line 249 of file FCurve.h.
◆ getPreExtrapolation()
Get the pre-extrapolation mode.
Definition at line 246 of file FCurve.h.
◆ numPoints()
| int Bifrost::Math::FCurve::numPoints |
( |
| ) |
const |
Number of points in the FCurve.
- Returns
- The number of points in this FCurve
◆ setExtrapolationModes()
Set the extrapolation modes of the regions before the first and after the last point.
Definition at line 270 of file FCurve.h.
◆ setPoints()
| void Bifrost::Math::FCurve::setPoints |
( |
FCurvePoints |
points | ) |
|
|
inline |
Set the array of segment points.
Definition at line 266 of file FCurve.h.
◆ Amino::FCurveSerializer
| friend class Amino::FCurveSerializer |
|
friend |