Game.h 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149
  1. #ifndef _Game_H_
  2. #define _Game_H_
  3. #include "pub.h"
  4. #include "PublicSDKMotion.h"
  5. #include "RunGame.h"
  6. #include "DanceGame.h"
  7. #include "Tricycle.h"
  8. #include "H5_Game.h"
  9. #include "Interaction.h"
  10. #include "FootStep.h"
  11. #include "FingerGuessing.h"
  12. #include "Aerobics.h"
  13. #include "Kongfu.h"
  14. #include "StepVel.h"
  15. #include "TestGame.h"
  16. #include <fstream>
  17. #include <time.h>
  18. #include <sstream>
  19. #if defined(_WIN32)
  20. #if defined( SDK_EXPORTS)
  21. #define SDK_EXPORT __declspec(dllexport)
  22. #else
  23. #define SDK_EXPORT __declspec(dllimport)
  24. #endif
  25. #else
  26. #define SDK_EXPORT
  27. #endif
  28. class SDK_EXPORT Game
  29. {
  30. public:
  31. Game(int gametype);
  32. void GameProcess(int gameTime, int* right_pos_data, int* right_att_data, int* right_acc_data, int right_zupt, int right_front_mag, int right_back_mag,
  33. int* left_pos_data, int* left_att_data, int* left_acc_data, int left_zupt, int left_front_mag, int left_back_mag,
  34. int jump, int down, int rssi);
  35. void GameProcessBuf(uint8_t* buf, int len);
  36. void getGameResult(int* matrix);
  37. void getFootAtt(int* left_att, int* right_att);
  38. string getGameDataStr();
  39. int getStepStatus(int left_or_right);
  40. int getStepFreq(int left_or_right);
  41. int getStepCount(int left_or_right);
  42. float getGamePos(int left_or_right, int index);
  43. string getVersion();
  44. int getInteractionCMD();
  45. int getGameStepVel();
  46. void setGameDataStr();
  47. int getMotionCount(int motion_type);
  48. bool setShoesDataBuff(int &gameTime, int* right_pos_data, int* right_att_data, int* right_acc_data, int &right_zupt, int& right_front_mag, int& right_back_mag,
  49. int* left_pos_data, int* left_att_data, int* left_acc_data, int& left_zupt, int& left_front_mag, int& left_back_mag,
  50. int& jump, int& down, int& rssi);
  51. private:
  52. int GameType;
  53. int leftStepRate;
  54. int rightStepRate;
  55. int leftRate;
  56. int rightRate;
  57. int resultMatrix[4];
  58. float leftRotate[4];
  59. float rightRotate[4];
  60. fstream foot_data_file;
  61. int InteractionCMD;
  62. int right_pos_data[3];
  63. int right_att_data[3];
  64. int left_pos_data[3];
  65. int left_att_data[3];
  66. int left_acc_data[3];
  67. int right_acc_data[3];
  68. int left_gyr_data[3];
  69. int right_gyr_data[3];
  70. int girl_shoes;
  71. int s_zupt;
  72. int h_zupt;
  73. int down;
  74. int jump;
  75. int rssi;
  76. int posTimeStamp;
  77. int attTimeStamp;
  78. uint32_t gameTime = 0;
  79. int lastTimeStamp = -1;
  80. uint16_t right_front_mag;
  81. uint16_t right_back_mag;
  82. uint16_t left_front_mag;
  83. uint16_t left_back_mag;
  84. string data_str;
  85. int shoes_down;
  86. PublicSDKMotion *game;
  87. FootStep leftFootStep;
  88. FootStep rightFootStep;
  89. StepVel stepVel;
  90. Interaction interaction;
  91. SHOES_DATA_STRUCT shoes_data_buff[5];
  92. int shoes_data_buff_size;
  93. int setShoesDataBuff_count;
  94. };
  95. #endif