V-ART
hermiteinterpolator.h
Go to the documentation of this file.
1 
5 #ifndef VART_HERMITEINTERPOLATOR_H
6 #define VART_HERMITEINTERPOLATOR_H
7 
8 #include "vart/interpolator.h"
9 #include <vector>
10 
11 namespace VART {
20  public:
21  // PUBLIC METHODS
22  HermiteInterpolator(float finalTime, float finalPosition);
23  virtual float GetValue(float linearIndex, float initialPos, float range) const
24  { return GetValue(linearIndex); }
25  virtual float GetValue(float linearIndex) const;
26  virtual TypeID GetID() const { return HERMITE; }
27 
29  void SetInitialPosition(float p) { positionVec[0] = p; }
30 
34  void AddControlPosition(float pos, float time);
35  protected:
36  // PROTECTED METHODS
38  int WarpIndex(int i) const;
39  // STATIC PROTECTED METHODS
41  static float Interpolate(float p1, float tg1, float p2, float tg2, float t);
42  // PROTECTED ATTRIBUTES
44  std::vector<float> positionVec;
45 
52  std::vector<float> timeVec;
53  }; // end class declaration
54 } // end namespace
55 #endif
static float Interpolate(float p1, float tg1, float p2, float tg2, float t)
Hermite 1D interpolation.
virtual TypeID GetID() const
void AddControlPosition(float pos, float time)
Adds a control position for interpolation.
virtual float GetValue(float linearIndex, float initialPos, float range) const
Evaluates a goal position for DOF interpolation.
std::vector< float > timeVec
A vector of times for each position.
Interpolator representation.
Definition: interpolator.h:17
HermiteInterpolator(float finalTime, float finalPosition)
int WarpIndex(int i) const
Warp index around valid vector indices.
void SetInitialPosition(float p)
Sets initial position for interpolation.
Hermite Spline interpolation.
Header file for V-ART class "Interpolator".
std::vector< float > positionVec
A vector of positions to interpolate.