Manages rotational paths with different interpolation techniques.
More...
#include "rotation_path.h"
Manages rotational paths with different interpolation techniques.
Definition at line 27 of file rotation_path.h.
◆ InterpType
Enumeration for types of interpolation.
| Enumerator |
|---|
| INTERP_STATIC | |
| INTERP_CONSTANT | |
| INTERP_LINEAR | |
| INTERP_CUBIC | |
Definition at line 34 of file rotation_path.h.
◆ RotationPath() [1/3]
◆ ~RotationPath()
| math::RotationPath::~RotationPath |
( |
| ) |
|
|
default |
◆ RotationPath() [2/3]
◆ RotationPath() [3/3]
◆ addCoord()
◆ finalize()
| void math::RotationPath::finalize |
( |
| ) |
|
◆ getCoords()
| const std::vector< RotationCoord > & math::RotationPath::getCoords |
( |
| ) |
const |
|
noexcept |
Gets the list of rotation coordinates.
- Returns
- A const reference to the vector of rotation coordinates.
Definition at line 76 of file rotation_path.h.
◆ getPosition()
Gets the rotational position at a given time.
- Parameters
-
| t | The time value for which to calculate the position. |
- Returns
- The calculated position as an SVec3.
- Exceptions
-
Definition at line 31 of file rotation_path.cpp.
32 {
33 if (!_final)
34 {
35 throw PathException("Finalize not called before getPosition in RotationPath.");
36 }
37 RotationCoord coord{};
38
39 switch (_type)
40 {
43 break;
46 break;
49 break;
53 break;
54 default:
55 throw PathException("Unknown interpolation type.");
56 }
57
58 return {1, coord.azimuth, coord.elevation};
59 }
constexpr RealType PI
Mathematical constant π (pi).
void getPositionLinear(RealType t, T &coord, const std::vector< T > &coords)
Performs linear interpolation between coordinate points.
void getPositionStatic(T &coord, const std::vector< T > &coords)
Interpolates a static position from a list of coordinates.
void getPositionCubic(RealType t, T &coord, const std::vector< T > &coords, const std::vector< T > &dd)
Performs cubic spline interpolation between coordinate points.
RealType elevation
Elevation angle.
RealType azimuth
Azimuth angle.
References math::RotationCoord::azimuth, math::RotationCoord::elevation, getPositionCubic(), getPositionLinear(), getPositionStatic(), INTERP_CONSTANT, INTERP_CUBIC, INTERP_LINEAR, INTERP_STATIC, and PI.
Referenced by fers_get_interpolated_rotation_path().
◆ getRate()
Gets the rate of change for the rotation.
- Returns
- The rotation rate.
Definition at line 90 of file rotation_path.h.
◆ getStart()
Gets the starting rotation coordinate.
- Returns
- The starting rotation coordinate.
Definition at line 83 of file rotation_path.h.
◆ getType()
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ setConstantRate()
Sets constant rate interpolation.
- Parameters
-
| setstart | The starting rotation coordinate. |
| setrate | The rate of change for the rotation. |
Definition at line 79 of file rotation_path.cpp.
80 {
81 _start = setstart;
82 _rate = setrate;
84 _final = true;
85 }
◆ setInterp()
| void math::RotationPath::setInterp |
( |
InterpType |
setinterp | ) |
|
|
noexcept |
◆ setRate()
Sets the rate of change for the rotation.
- Parameters
-
| rate | The new rate of change for the rotation. |
Definition at line 120 of file rotation_path.h.
RealType rate() noexcept
Get the rendering sample rate.
◆ setStart()
Sets the starting rotation coordinate.
- Parameters
-
| start | The new starting rotation coordinate. |
Definition at line 113 of file rotation_path.h.
The documentation for this class was generated from the following files: