RunGame.h 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. #pragma once
  2. #ifndef _RunGame_H_
  3. #define _RunGame_H_
  4. #include <vector>
  5. using namespace std;
  6. struct POS_X_CELL
  7. {
  8. //位置
  9. int pos_x;
  10. int pos_y;
  11. int pos_z;
  12. //角度
  13. int heading;
  14. int pitch;
  15. int zupt;
  16. };
  17. class RunGame
  18. {
  19. public:
  20. RunGame();
  21. int getResultLeftRight(int* pos, int devNum);
  22. int getResultJump(int jump);
  23. int getResultDown(int down);
  24. void setResultConLeft(int zupt);
  25. void setResultConRight(int zupt);
  26. int getResultLeft(int *pos, int girl_shoes, float pitch);
  27. int getResultRight(int* pos, int girl_shoes, float pitch);
  28. //void Process(int* right_pos, int* right_att, int right_zupt, int* left_pos,
  29. // int* left_att, int left_zupt, int jump, int down, int girl_shoes);
  30. void Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
  31. int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
  32. int jump, int down, int rssi);
  33. void getResult(int *dec);
  34. int getAccStatus(int zupt, int* acc, int* max_acc, int* min_acc);
  35. void setGameheading(int left_zupt, int right_zupt, float left_heading, float right_heading, int rssi);
  36. void rotateGamePos(int* pos, int left_or_right);
  37. float getGamePos(int left_or_right, int index);
  38. //int calResult(vector<POS_X_CELL> &q, int last_zupt , int zupt, int left_or_right);
  39. private:
  40. int last_down;
  41. int last_jump;
  42. int left_has_result;
  43. int right_has_result;
  44. int left_zupt;
  45. int right_zupt;
  46. int left_pos_offset_min;
  47. int right_pos_offset_min;
  48. int left_last_pos[3];
  49. int right_last_pos[3];
  50. int result[4];
  51. int last_jump_time;
  52. int right_acc_status;
  53. int left_acc_status;
  54. int right_acc_max[3];
  55. int left_acc_max[3];
  56. int right_acc_min[3];
  57. int left_acc_min[3];
  58. //开局重置方向
  59. float left_reset_heading;
  60. float right_reset_heading;
  61. int has_init_heading;
  62. int zupt_count;
  63. //测试用的pos
  64. int left_game_pos[3];
  65. int right_game_pos[3];
  66. int last_left_zupt;
  67. int last_right_zupt;
  68. vector<POS_X_CELL> left_q;
  69. vector<POS_X_CELL> right_q;
  70. };
  71. #endif