![]() |
NDEVR
API Documentation
|
A monotone cubic Hermite spline path that interpolates values over time. More...
Public Member Functions | |
| Path () | |
| Default constructor. | |
| Path (const Buffer< Time > &time, const Buffer< fltp04 > &y, const Buffer< fltp04 > &m) | |
| Constructs a Path from pre-computed time, value, and tangent buffers. | |
| Path (const Path &&path) | |
| Move constructor. | |
| Path (const Path &path) | |
| Copy constructor. | |
| fltp08 | interpolateX (const Time ¤t_time) |
| Interpolates the path value at a given time using cubic Hermite spline interpolation. | |
| Path & | operator= (const Path &path) |
| Copy assignment operator. | |
Static Public Member Functions | |
| static Path | createMonotoneAngleCubicPathSorted (const Buffer< Time > &time, const Buffer< Angle< fltp08 > > &y) |
| Creates a monotone cubic angle path after sorting the control points by time in descending order. | |
| static Path | createMonotoneCubicPath (const Buffer< Time > &time, const Buffer< fltp04 > &y) |
| Creates a monotone cubic Hermite spline path from time-value control points. | |
| static Path | createMonotoneCubicPathAzimuth (const Buffer< Time > &time, const Buffer< Angle< fltp08 > > &y) |
| Creates a monotone cubic Hermite spline path for azimuth (angular) values over time. | |
| static Path | createMonotoneCubicPathSorted (const Buffer< Time > &time, const Buffer< fltp04 > &y) |
| Creates a monotone cubic path after sorting the control points by time in descending order. | |
Protected Attributes | |
| Buffer< fltp04 > | mM |
| The tangent (slope) values at each control point, used for Hermite interpolation. | |
| Buffer< Time > | mX |
| The time values (X-axis) for each control point. | |
| Buffer< fltp04 > | mY |
| The interpolated values (Y-axis) at each control point. | |
A monotone cubic Hermite spline path that interpolates values over time.
Provides functionality to create and evaluate piecewise cubic Hermite interpolating polynomials from a set of time-value control points. The interpolation preserves monotonicity of the data, meaning it will not introduce spurious oscillations between data points. This is commonly used for smooth camera or object animation paths.
Definition at line 46 of file TimePath.h.
|
inline |
Default constructor.
Creates an empty path with no control points.
Definition at line 52 of file TimePath.h.
Referenced by Path(), Path(), createMonotoneAngleCubicPathSorted(), createMonotoneCubicPath(), createMonotoneCubicPathAzimuth(), createMonotoneCubicPathSorted(), and operator=().
|
inline |
Constructs a Path from pre-computed time, value, and tangent buffers.
| [in] | time | The time values for each control point. |
| [in] | y | The interpolated values at each control point. |
| [in] | m | The tangent (slope) values at each control point. |
Definition at line 61 of file TimePath.h.
|
inline |
|
inline |
|
inlinestatic |
Creates a monotone cubic angle path after sorting the control points by time in descending order.
Sorts the time-angle pairs so that time values are in descending order, then constructs a monotone cubic spline that handles azimuth wraparound.
| [in] | time | The unsorted time values for each control point. |
| [in] | y | The azimuth angle values at each control point. |
Definition at line 285 of file TimePath.h.
References Path(), Buffer< t_type, t_memory_manager >::add(), and createMonotoneCubicPathAzimuth().
|
inlinestatic |
Creates a monotone cubic Hermite spline path from time-value control points.
Constructs a Path whose spline interpolation preserves the monotonicity of the input data. The Fritsch-Carlson method is used to compute tangents that prevent overshooting between data points. The time values must be strictly increasing.
| [in] | time | The strictly increasing time values for each control point. |
| [in] | y | The values at each control point. |
| Exception | if fewer than two control points are provided, or if arrays differ in size, or if time values are not strictly increasing. |
Definition at line 140 of file TimePath.h.
References Path(), cast(), and hypot().
Referenced by createMonotoneCubicPathAzimuth(), and createMonotoneCubicPathSorted().
|
inlinestatic |
Creates a monotone cubic Hermite spline path for azimuth (angular) values over time.
Handles the wraparound discontinuity at +/-180 degrees by inserting intermediate control points near the boundary. This prevents the spline from interpolating the long way around when crossing the +/-180 degree seam.
| [in] | time | The time values for each control point. |
| [in] | y | The azimuth angle values at each control point. |
| Exception | if fewer than two control points are provided or arrays differ in size. |
Definition at line 208 of file TimePath.h.
References Path(), Buffer< t_type, t_memory_manager >::add(), cast(), and createMonotoneCubicPath().
Referenced by createMonotoneAngleCubicPathSorted(), and MovementPath::setAngleChannel().
|
inlinestatic |
Creates a monotone cubic path after sorting the control points by time in descending order.
Sorts the time-value pairs so that time values are in descending order before constructing the monotone cubic spline. Useful when control points are not provided in chronological order.
| [in] | time | The unsorted time values for each control point. |
| [in] | y | The values at each control point, corresponding to the time values. |
Definition at line 252 of file TimePath.h.
References Path(), Buffer< t_type, t_memory_manager >::add(), and createMonotoneCubicPath().
Referenced by MovementPath::setPositionChannel().
Interpolates the path value at a given time using cubic Hermite spline interpolation.
Evaluates the monotone cubic Hermite spline at the specified time. If the time is before the first control point, the first value is returned. If after the last, the last value is returned. Returns Constant<fltp08>::Invalid if the time is invalid or the path is empty.
| [in] | current_time | The time at which to evaluate the interpolated value. |
Definition at line 98 of file TimePath.h.
References IsInvalid(), mM, mX, and mY.