123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- #ifndef _Game_H_
- #define _Game_H_
- #include "pub.h"
- #include "PublicSDKMotion.h"
- #include "RunGame.h"
- #include "DanceGame.h"
- #include "Tricycle.h"
- #include "H5_Game.h"
- #include "Interaction.h"
- #include "FootStep.h"
- #include "FingerGuessing.h"
- #include "Aerobics.h"
- #include "Kongfu.h"
- #include "SportFunction.h"
- #include "BuildHouse.h"
- #include "CutCake.h"
- #include "StepVel.h"
- #include "TestGame.h"
- #include "online_motion.h"
- #include <fstream>
- #include <time.h>
- #include <sstream>
- #if defined(_WIN32)
- #if defined( SDK_EXPORTS)
- #define SDK_EXPORT __declspec(dllexport)
- #else
- #define SDK_EXPORT __declspec(dllimport)
- #endif
- #else
- #define SDK_EXPORT
- #endif
- class SDK_EXPORT Game
- {
- public:
- Game(int gametype);
- 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,
- int* left_pos_data, int* left_att_data, int* left_acc_data, int left_zupt, int left_front_mag, int left_back_mag,
- int jump, int down, int rssi);
- void GameProcessBuf(uint8_t* buf, int len);
- void getGameResult(int* matrix);
- void getFootAtt(int* left_att, int* right_att);
- string getGameDataStr();
- int getStepStatus(int left_or_right);
- int getStepFreq(int left_or_right);
- int getStepCount(int left_or_right);
- float getGamePos(int left_or_right, int index);
- string getVersion();
- int getInteractionCMD();
- int getGameStepVel();
- void setGameDataStr();
- int getMotionCount(int motion_type);
- 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,
- int* left_pos_data, int* left_att_data, int* left_acc_data, int& left_zupt, int& left_front_mag, int& left_back_mag,
- int& jump, int& down, int& rssi);
- private:
- int GameType;
- int leftStepRate;
- int rightStepRate;
-
- int leftRate;
- int rightRate;
- int resultMatrix[RESULT_LEN];
- float leftRotate[4];
-
- float rightRotate[4];
- fstream foot_data_file;
- int InteractionCMD;
- int right_pos_data[3];
- int right_att_data[3];
- int left_pos_data[3];
- int left_att_data[3];
- int left_acc_data[3];
- int right_acc_data[3];
- int left_gyr_data[3];
- int right_gyr_data[3];
- int girl_shoes;
- int s_zupt;
- int h_zupt;
- int down;
- int jump;
- int rssi;
- int posTimeStamp;
- int attTimeStamp;
- uint32_t gameTime = 0;
- int lastTimeStamp = -1;
- uint16_t right_front_mag;
- uint16_t right_back_mag;
- uint16_t left_front_mag;
- uint16_t left_back_mag;
- string data_str;
- int shoes_down;
- PublicSDKMotion *game;
- FootStep leftFootStep;
- FootStep rightFootStep;
- StepVel stepVel;
- Interaction interaction;
- int shoes_data_buff_size;
- int setShoesDataBuff_count;
- online_motion extract_motion;
- };
- #endif
|