Splines.
More...
#include <math/gzmath.hh>
|
| Spline () |
| constructor
|
|
| ~Spline () |
| destructor
|
|
void | AddPoint (const Vector3 &_pt) |
| Adds a control point to the end of the spline.
|
|
void | Clear () |
| Clears all the points in the spline.
|
|
Vector3 | GetPoint (unsigned int _index) const |
| Gets the detail of one of the control points of the spline.
|
|
unsigned int | GetPointCount () const |
| Gets the number of control points in the spline.
|
|
Vector3 | GetTangent (unsigned int _index) const |
| Get the tangent value for a point.
|
|
double | GetTension () const |
| Get the tension value.
|
|
Vector3 | Interpolate (double _t) const |
| Returns an interpolated point based on a parametric value over the whole series.
|
|
Vector3 | Interpolate (unsigned int _fromIndex, double _t) const |
| Interpolates a single segment of the spline given a parametric value.
|
|
void | RecalcTangents () |
| Recalculates the tangents associated with this spline.
|
|
void | SetAutoCalculate (bool _autoCalc) |
| Tells the spline whether it should automatically calculate tangents on demand as points are added.
|
|
void | SetTension (double _t) |
| Set the tension parameter.
|
|
void | UpdatePoint (unsigned int _index, const Vector3 &_value) |
| Updates a single point in the spline.
|
|
|
bool | autoCalc |
| when true, the tangents are recalculated when the control point change
|
|
Matrix4 | coeffs |
| Matrix of coefficients.
|
|
std::vector< Vector3 > | points |
| control points
|
|
std::vector< Vector3 > | tangents |
| tangents
|
|
double | tension |
| Tension of 0 = Catmull-Rom spline, otherwise a Cardinal spline.
|
|
gazebo::math::Spline::Spline |
( |
| ) |
|
gazebo::math::Spline::~Spline |
( |
| ) |
|
void gazebo::math::Spline::AddPoint |
( |
const Vector3 & |
_pt | ) |
|
Adds a control point to the end of the spline.
- Parameters
-
void gazebo::math::Spline::Clear |
( |
| ) |
|
Clears all the points in the spline.
Vector3 gazebo::math::Spline::GetPoint |
( |
unsigned int |
_index | ) |
const |
Gets the detail of one of the control points of the spline.
- Parameters
-
[in] | _index | the control point index |
- Returns
- the control point, or [0,0,0] and a message on the error stream
unsigned int gazebo::math::Spline::GetPointCount |
( |
| ) |
const |
Gets the number of control points in the spline.
- Returns
- the count
Vector3 gazebo::math::Spline::GetTangent |
( |
unsigned int |
_index | ) |
const |
Get the tangent value for a point.
- Parameters
-
[in] | _index | the control point index |
double gazebo::math::Spline::GetTension |
( |
| ) |
const |
Get the tension value.
- Returns
- The value of the tension, which is between 0.0 and 1.0
Vector3 gazebo::math::Spline::Interpolate |
( |
double |
_t | ) |
const |
Returns an interpolated point based on a parametric value over the whole series.
- Parameters
-
[in] | _t | parameter (range 0 to 1) |
Vector3 gazebo::math::Spline::Interpolate |
( |
unsigned int |
_fromIndex, |
|
|
double |
_t |
|
) |
| const |
Interpolates a single segment of the spline given a parametric value.
- Parameters
-
[in] | _fromIndex | The point index to treat as t = 0. fromIndex + 1 is deemed to be t = 1 |
[in] | _t | Parametric value |
void gazebo::math::Spline::RecalcTangents |
( |
| ) |
|
Recalculates the tangents associated with this spline.
void gazebo::math::Spline::SetAutoCalculate |
( |
bool |
_autoCalc | ) |
|
Tells the spline whether it should automatically calculate tangents on demand as points are added.
- Parameters
-
[in] | _autoCalc | If true, tangents are calculated for you whenever a point changes. If false, you must call reclacTangents to recalculate them when it best suits. |
void gazebo::math::Spline::SetTension |
( |
double |
_t | ) |
|
Set the tension parameter.
A value of 0 = Catmull-Rom spline.
- Parameters
-
[in] | _t | Tension value between 0.0 and 1.0 |
void gazebo::math::Spline::UpdatePoint |
( |
unsigned int |
_index, |
|
|
const Vector3 & |
_value |
|
) |
| |
Updates a single point in the spline.
- Parameters
-
[in] | _index | the control point index |
[in] | _value | the new position |
bool gazebo::math::Spline::autoCalc |
|
protected |
when true, the tangents are recalculated when the control point change
Matrix4 gazebo::math::Spline::coeffs |
|
protected |
std::vector<Vector3> gazebo::math::Spline::points |
|
protected |
std::vector<Vector3> gazebo::math::Spline::tangents |
|
protected |
double gazebo::math::Spline::tension |
|
protected |
Tension of 0 = Catmull-Rom spline, otherwise a Cardinal spline.
The documentation for this class was generated from the following file: