EquirectangularToFovSpeed.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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, int step=1);
  13. ///< \p step is the interval to use between samples for speed calculation. It acts
  14. ///< as simple filtering.
  15. virtual ~EquirectangularToFovSpeed();
  16. void AddSpeed();
  17. ///< Adds three new attributes to ARFF representing speed in deg/s for eye+head,
  18. ///< eye within head (fov) and head only.
  19. vector<double> GetHeadSpeed();
  20. vector<double> GetEyeFovSpeed();
  21. vector<double> GetHeadPlusEyeSpeed();
  22. private:
  23. void GetSpeed(const vector<Vec3> &inVec, const int attInd);
  24. vector<double> GetSpeed(const vector<Vec3> &inVec);
  25. void FillVectors();
  26. void SphericalToFov(double horRads, double verRads, double *x, double *y);
  27. vector<Vec3> m_vEyeFov;
  28. vector<Vec3> m_vHead;
  29. vector<Vec3> m_vHeadEye;
  30. vector<double> m_vXfov;
  31. vector<double> m_vYfov;
  32. int m_step;
  33. };
  34. #endif /*__EQUIRECTANGULARTOFOVSPEED_H__*/