EquirectangularToFovSpeed.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // EquirectangularToFovSpeed.h
  2. //
  3. // Calculation of eye within head, head and head+eye speeds. These are absolute
  4. // values in degrees per second
  5. #ifndef __EQUIRECTANGULARTOFOVSPEED_H__
  6. #define __EQUIRECTANGULARTOFOVSPEED_H__
  7. #include "EquirectangularToFovBase.h"
  8. using namespace std;
  9. class EquirectangularToFovSpeed : public EquirectangularToFovBase
  10. {
  11. public:
  12. EquirectangularToFovSpeed(Arff *pArff, double integrationPeriod=1);
  13. ///< \p integrationPeriod is the duration that is used for the calculation of the
  14. ///< step that is used between samples for speed calculation. It acts
  15. ///< as simple filtering.
  16. virtual ~EquirectangularToFovSpeed();
  17. void AddSpeed();
  18. ///< Adds three new attributes to ARFF representing speed in deg/s for eye+head,
  19. ///< eye within head (fov) and head only.
  20. vector<double> GetHeadSpeed();
  21. vector<double> GetEyeFovSpeed();
  22. vector<double> GetHeadPlusEyeSpeed();
  23. private:
  24. void GetSpeed(const vector<Vec3> &inVec, const int attInd);
  25. vector<double> GetSpeed(const vector<Vec3> &inVec);
  26. void FillVectors();
  27. void SphericalToFov(double horRads, double verRads, double *x, double *y);
  28. vector<Vec3> m_vEyeFov;
  29. vector<Vec3> m_vHead;
  30. vector<Vec3> m_vHeadEye;
  31. vector<double> m_vXfov;
  32. vector<double> m_vYfov;
  33. int m_step;
  34. };
  35. #endif /*__EQUIRECTANGULARTOFOVSPEED_H__*/