|
@@ -1,387 +1,387 @@
|
|
|
-
|
|
|
-#import "GameObjc.h"
|
|
|
-#include "Game.h"
|
|
|
-#include "DanceGame.h"
|
|
|
-#include "FootStep.h"
|
|
|
-#include "InertialTrajProcess.h"
|
|
|
-//#include "OriginTraj.h"
|
|
|
-//#include <math.h>
|
|
|
-
|
|
|
-#define NSLog(format, ...) printf("TIME:%s FILE:%s(%d行) FUNCTION:%s \n %s\n\n",__TIME__, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String])
|
|
|
-
|
|
|
-
|
|
|
-@interface GameObjc()
|
|
|
-{
|
|
|
-@private
|
|
|
- Game *game;
|
|
|
- int gametype;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@implementation GameObjc
|
|
|
-
|
|
|
-- (instancetype)initWithGametype:(int)gametype{
|
|
|
- self = [super init];
|
|
|
- if (self){
|
|
|
- gametype = gametype;
|
|
|
- game = new Game(gametype);
|
|
|
- }
|
|
|
- return self;
|
|
|
-}
|
|
|
-
|
|
|
-- (void)gameProcess:(int)timeStamp
|
|
|
- rightPos:(int *)rightPos
|
|
|
- rightAtt:(int *)rightAtt
|
|
|
- rightAcc:(int *)rightAcc
|
|
|
- rightZupt:(int)rightZupt
|
|
|
- right_press:(int)right_press
|
|
|
- leftPos:(int *)leftPos
|
|
|
- leftAtt:(int *)leftAtt
|
|
|
- leftAcc:(int *)leftAcc
|
|
|
- leftZupt:(int)leftZupt
|
|
|
- left_press:(int)left_press
|
|
|
- jump:(int)jump
|
|
|
- down:(int)down
|
|
|
- rssi:(int)rssi
|
|
|
- girl_shoes:(int)girl_shoes{
|
|
|
- game->GameProcess(timeStamp, rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down, rssi,girl_shoes);
|
|
|
-}
|
|
|
-
|
|
|
-- (void)runGameProcess:(int)timeStamp
|
|
|
- rightPos:(int *)rightPos
|
|
|
- rightAtt:(int *)rightAtt
|
|
|
- rightAcc:(int *)rightAcc
|
|
|
- rightZupt:(int)rightZupt
|
|
|
- right_press:(int)right_press
|
|
|
- leftPos:(int *)leftPos
|
|
|
- leftAtt:(int *)leftAtt
|
|
|
- leftAcc:(int *)leftAcc
|
|
|
- leftZupt:(int)leftZupt
|
|
|
- left_press:(int)left_press
|
|
|
- jump:(int)jump
|
|
|
- down:(int)down
|
|
|
- girl_shoes:(int)girl_shoes{
|
|
|
- game->RunGameProcess(rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down,girl_shoes);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-- (void)getGameResult:(int *)matrix{
|
|
|
- game->getGameResult(matrix);
|
|
|
-}
|
|
|
-
|
|
|
-- (int)getStepFreq:(int)leftOrRight{
|
|
|
- return game->getStepFreq(leftOrRight);
|
|
|
-}
|
|
|
-- (int)getStepStatus:(int)leftOrRight{
|
|
|
- return game->getStepStatus(leftOrRight);
|
|
|
-}
|
|
|
-- (int)getStepCount:(int)leftOrRight{
|
|
|
- return game->getStepCount(leftOrRight);
|
|
|
-}
|
|
|
-
|
|
|
-- (float)getGamePos:(int)left_or_right index:(int)index{
|
|
|
- return game->getGamePos(left_or_right, index);
|
|
|
-}
|
|
|
-
|
|
|
-- (void)start{
|
|
|
- game->start(nil);
|
|
|
-}
|
|
|
-- (void)end{
|
|
|
- game->end();
|
|
|
-}
|
|
|
-
|
|
|
-- (void)isBingo{
|
|
|
- game->isBingo();
|
|
|
-}
|
|
|
-
|
|
|
--(int)getInteractionCMD{
|
|
|
- return game->getInteractionCMD();
|
|
|
-}
|
|
|
-
|
|
|
--(NSString*)getGameDataStr{
|
|
|
-
|
|
|
-// NSString * string = [NSString stringWithCString:game->getGameDataStr().c_str() encoding:[NSString defaultCStringEncoding]];
|
|
|
- NSString * aString = [NSString stringWithUTF8String:game->getGameDataStr().c_str()];
|
|
|
-// NSLog(@"剑波需要的数据1 %@",string);
|
|
|
-// NSLog(@"剑波需要的数据2 %@",aString);
|
|
|
- return aString;
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
--(void)GameProcessBuf:(uint8_t*)buff length:(int)length{
|
|
|
-
|
|
|
- game->GameProcessBuf(buff, length);
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-/// 向外提供,手动释放
|
|
|
-- (void)handRelease{
|
|
|
- delete game;
|
|
|
-}
|
|
|
-- (void)dealloc{
|
|
|
- delete game;
|
|
|
-}
|
|
|
-
|
|
|
-@end
|
|
|
-
|
|
|
-@interface RunGameObjc ()
|
|
|
-{
|
|
|
- @private
|
|
|
- RunGame * runGame;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@implementation RunGameObjc
|
|
|
-- (instancetype)init{
|
|
|
- self = [super init];
|
|
|
- if (self) {
|
|
|
- runGame = new RunGame();
|
|
|
- }
|
|
|
- return self;
|
|
|
-}
|
|
|
-- (int)getResultLeftRight:(int *)pos
|
|
|
- devNum:(short)devNum{
|
|
|
- return runGame->getResultLeftRight(pos, devNum);
|
|
|
-}
|
|
|
-- (int)getResultJump:(short)jump{
|
|
|
- return runGame->getResultJump(jump);
|
|
|
-}
|
|
|
-- (int)getResultDown:(short)down{
|
|
|
- return runGame->getResultDown(down);
|
|
|
-}
|
|
|
-- (void)setResultConLeft:(short)zupt{
|
|
|
- runGame->setResultConLeft(zupt);
|
|
|
-}
|
|
|
-- (void)setResultConRight:(short)zupt{
|
|
|
- runGame->setResultConRight(zupt);
|
|
|
-}
|
|
|
-- (int)getResultLeft:(int *)pos girl_shoes:(int)girl_shoes{
|
|
|
- return runGame->getResultLeft(pos,girl_shoes);
|
|
|
-}
|
|
|
-- (int)getResultRight:(int *)pos girl_shoes:(int)girl_shoes{
|
|
|
- return runGame->getResultRight(pos,girl_shoes);
|
|
|
-}
|
|
|
-
|
|
|
-- (void)process:(int)timeStamp
|
|
|
- rightPos:(int *)rightPos
|
|
|
- rightAtt:(int *)rightAtt
|
|
|
- rightAcc:(int *)rightAcc
|
|
|
- rightZupt:(int)rightZupt
|
|
|
- right_press:(int)right_press
|
|
|
- leftPos:(int *)leftPos
|
|
|
- leftAtt:(int *)leftAtt
|
|
|
- leftAcc:(int *)leftAcc
|
|
|
- leftZupt:(int)leftZupt
|
|
|
- left_press:(int)left_press
|
|
|
- jump:(int)jump
|
|
|
- down:(int)down
|
|
|
- girl_shoes:(int)girl_shoes{
|
|
|
-
|
|
|
- runGame->Process(rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down,girl_shoes);
|
|
|
-
|
|
|
-// Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
|
|
|
-// int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
|
|
|
-// int jump, int down, int girl_shoes)
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-- (void)getResult:(int *)dec{
|
|
|
- runGame->getResult(dec);
|
|
|
-}
|
|
|
-
|
|
|
-/// 向外提供,手动释放
|
|
|
-- (void)handRelease{
|
|
|
- delete runGame;
|
|
|
-}
|
|
|
-- (void)dealloc{
|
|
|
- delete runGame;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@interface DanceGameObjc()
|
|
|
-{
|
|
|
-@private
|
|
|
- DanceGame *danceGame;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@implementation DanceGameObjc
|
|
|
-- (instancetype)init{
|
|
|
- self = [super init];
|
|
|
- if (self) {
|
|
|
- danceGame = new DanceGame();
|
|
|
- }
|
|
|
- return self;
|
|
|
-}
|
|
|
-
|
|
|
-//- (int)gamePositionProcess:(int *)pos
|
|
|
-// stepPos:(int *)stepPos
|
|
|
-// rssi:(int)rssi
|
|
|
-// hostOrSlave:(short)hostOrSlave{
|
|
|
-// //SInt16 ==> short*
|
|
|
-// return danceGame->game_position_process(pos, stepPos, rssi, hostOrSlave);
|
|
|
-//}
|
|
|
-
|
|
|
-//- (void)gameBoundary:(int *)globalPos{
|
|
|
-// danceGame->game_boundary(globalPos);
|
|
|
-//}
|
|
|
-//- (int)getDirectionFloat:(float *)pos
|
|
|
-// rssi:(int)rssi{
|
|
|
-// //float==>32位
|
|
|
-// return danceGame->getDirectionFloat(pos,rssi);
|
|
|
-//}
|
|
|
-//- (short)danceGameProcess:(int *)pos
|
|
|
-// zupt:(short)zupt
|
|
|
-// rssi:(int)rssi
|
|
|
-// hostOrSlave:(short)hostOrSlave{
|
|
|
-// return danceGame->dance_game_process(pos, zupt, rssi, hostOrSlave);
|
|
|
-//}
|
|
|
-
|
|
|
-- (void)process:(int *)rightPos
|
|
|
- rightAtt:(int *)rightAtt
|
|
|
- rightAcc:(int *)rightAcc
|
|
|
- rightZupt:(int)rightZupt
|
|
|
- right_press:(int)right_press
|
|
|
- leftPos:(int *)leftPos
|
|
|
- leftAtt:(int *)leftAtt
|
|
|
- leftAcc:(int *)leftAcc
|
|
|
- leftZupt:(int)leftZupt
|
|
|
- left_press:(int)left_press
|
|
|
- jump:(int)jump
|
|
|
- down:(int)down
|
|
|
- rssi:(int)rssi{
|
|
|
- danceGame->Process(rightPos, rightAtt,rightAcc, rightZupt, right_press,leftPos, leftAtt,leftAtt, leftZupt, left_press,jump, down, rssi);
|
|
|
-}
|
|
|
-
|
|
|
-- (void)getResult:(int *)matrix{
|
|
|
- danceGame->getResult(matrix);
|
|
|
-}
|
|
|
-//- (float)getRssiDistance:(int)rssi{
|
|
|
-// return danceGame->getRssiDistance(rssi);
|
|
|
-//}
|
|
|
-//- (int)savePosAndRssi:(int *)pos
|
|
|
-// zupt:(short)zupt
|
|
|
-// rssi:(int)rssi
|
|
|
-// hostOrSlave:(short)hostOrSlave{
|
|
|
-// return danceGame->savePosAndRssi(pos, zupt, rssi, hostOrSlave);
|
|
|
-//}
|
|
|
-/// 向外提供,手动释放
|
|
|
-- (void)handRelease{
|
|
|
- delete danceGame;
|
|
|
-}
|
|
|
-- (void)dealloc{
|
|
|
- delete danceGame;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@interface FootStepObjc ()
|
|
|
-{
|
|
|
-@private
|
|
|
- FootStep *footStep;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-@implementation FootStepObjc
|
|
|
-
|
|
|
-- (instancetype)init{
|
|
|
- self = [super init];
|
|
|
- if (self) {
|
|
|
- footStep = new FootStep();
|
|
|
- }
|
|
|
- return self;
|
|
|
-}
|
|
|
-//pos开辟3个空间
|
|
|
-- (void)stepCal:(int)timeStamp posList:(int *)pos zupt:(int)zupt girl_shoes:(int)girl_shoes{
|
|
|
- footStep->stepCal(timeStamp, pos, zupt,girl_shoes);
|
|
|
-}
|
|
|
-- (int)getStepFreq{
|
|
|
- return footStep->getStepFreq();
|
|
|
-}
|
|
|
-- (int)getStepStatus{
|
|
|
- return footStep->getStepStatus();
|
|
|
-}
|
|
|
-- (int)getStepCount{
|
|
|
- return footStep->getStepCount();
|
|
|
-}
|
|
|
-- (void)dealloc{
|
|
|
- delete footStep;
|
|
|
-}
|
|
|
-/// 向外提供,手动释放
|
|
|
-- (void)handRelease{
|
|
|
- delete footStep;
|
|
|
-}
|
|
|
-
|
|
|
-@end
|
|
|
-
|
|
|
-@interface InertialTrajProcessObjc ()
|
|
|
-{
|
|
|
- @private
|
|
|
- InertialTrajProcess * inertialTrajProcess;
|
|
|
-}
|
|
|
-@end
|
|
|
-@implementation InertialTrajProcessObjc
|
|
|
-- (instancetype)init{
|
|
|
- self = [super init];
|
|
|
- if (self) {
|
|
|
- inertialTrajProcess = new InertialTrajProcess();
|
|
|
- }
|
|
|
- return self;
|
|
|
-}
|
|
|
-- (void)trajRotate:(int *)pos{
|
|
|
- inertialTrajProcess->TrajRotate(pos);
|
|
|
-}
|
|
|
-//rotateMatrix只能开辟4个空间
|
|
|
-- (void)trajRotate:(int *)pos
|
|
|
- rotateMatrix:(float *)rotateMatrix{
|
|
|
- inertialTrajProcess->TrajRotate(pos,rotateMatrix);
|
|
|
-}
|
|
|
-- (void)resetHeading:(short)heading{
|
|
|
- inertialTrajProcess->ResetHeading(heading);
|
|
|
-}
|
|
|
-/// 向外提供,手动释放
|
|
|
-- (void)handRelease{
|
|
|
- delete inertialTrajProcess;
|
|
|
-}
|
|
|
-- (void)dealloc{
|
|
|
- delete inertialTrajProcess;
|
|
|
-}
|
|
|
-@end
|
|
|
-
|
|
|
-
|
|
|
-//@interface OriginTrajObj ()
|
|
|
+//
|
|
|
+//#import "GameObjc.h"
|
|
|
+//#include "Game.h"
|
|
|
+//#include "DanceGame.h"
|
|
|
+//#include "FootStep.h"
|
|
|
+//#include "InertialTrajProcess.h"
|
|
|
+////#include "OriginTraj.h"
|
|
|
+////#include <math.h>
|
|
|
+//
|
|
|
+//#define NSLog(format, ...) printf("TIME:%s FILE:%s(%d行) FUNCTION:%s \n %s\n\n",__TIME__, [[[NSString stringWithUTF8String:__FILE__] lastPathComponent] UTF8String], __LINE__, __PRETTY_FUNCTION__, [[NSString stringWithFormat:(format), ##__VA_ARGS__] UTF8String])
|
|
|
+//
|
|
|
+//
|
|
|
+//@interface GameObjc()
|
|
|
+//{
|
|
|
+//@private
|
|
|
+// Game *game;
|
|
|
+// int gametype;
|
|
|
+//}
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@implementation GameObjc
|
|
|
+//
|
|
|
+//- (instancetype)initWithGametype:(int)gametype{
|
|
|
+// self = [super init];
|
|
|
+// if (self){
|
|
|
+// gametype = gametype;
|
|
|
+// game = new Game(gametype);
|
|
|
+// }
|
|
|
+// return self;
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)gameProcess:(int)timeStamp
|
|
|
+// rightPos:(int *)rightPos
|
|
|
+// rightAtt:(int *)rightAtt
|
|
|
+// rightAcc:(int *)rightAcc
|
|
|
+// rightZupt:(int)rightZupt
|
|
|
+// right_press:(int)right_press
|
|
|
+// leftPos:(int *)leftPos
|
|
|
+// leftAtt:(int *)leftAtt
|
|
|
+// leftAcc:(int *)leftAcc
|
|
|
+// leftZupt:(int)leftZupt
|
|
|
+// left_press:(int)left_press
|
|
|
+// jump:(int)jump
|
|
|
+// down:(int)down
|
|
|
+// rssi:(int)rssi
|
|
|
+// girl_shoes:(int)girl_shoes{
|
|
|
+// game->GameProcess(timeStamp, rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down, rssi,girl_shoes);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)runGameProcess:(int)timeStamp
|
|
|
+// rightPos:(int *)rightPos
|
|
|
+// rightAtt:(int *)rightAtt
|
|
|
+// rightAcc:(int *)rightAcc
|
|
|
+// rightZupt:(int)rightZupt
|
|
|
+// right_press:(int)right_press
|
|
|
+// leftPos:(int *)leftPos
|
|
|
+// leftAtt:(int *)leftAtt
|
|
|
+// leftAcc:(int *)leftAcc
|
|
|
+// leftZupt:(int)leftZupt
|
|
|
+// left_press:(int)left_press
|
|
|
+// jump:(int)jump
|
|
|
+// down:(int)down
|
|
|
+// girl_shoes:(int)girl_shoes{
|
|
|
+// game->RunGameProcess(rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down,girl_shoes);
|
|
|
+//
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)getGameResult:(int *)matrix{
|
|
|
+// game->getGameResult(matrix);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (int)getStepFreq:(int)leftOrRight{
|
|
|
+// return game->getStepFreq(leftOrRight);
|
|
|
+//}
|
|
|
+//- (int)getStepStatus:(int)leftOrRight{
|
|
|
+// return game->getStepStatus(leftOrRight);
|
|
|
+//}
|
|
|
+//- (int)getStepCount:(int)leftOrRight{
|
|
|
+// return game->getStepCount(leftOrRight);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (float)getGamePos:(int)left_or_right index:(int)index{
|
|
|
+// return game->getGamePos(left_or_right, index);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)start{
|
|
|
+// game->start(nil);
|
|
|
+//}
|
|
|
+//- (void)end{
|
|
|
+// game->end();
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)isBingo{
|
|
|
+// game->isBingo();
|
|
|
+//}
|
|
|
+//
|
|
|
+//-(int)getInteractionCMD{
|
|
|
+// return game->getInteractionCMD();
|
|
|
+//}
|
|
|
+//
|
|
|
+//-(NSString*)getGameDataStr{
|
|
|
+//
|
|
|
+//// NSString * string = [NSString stringWithCString:game->getGameDataStr().c_str() encoding:[NSString defaultCStringEncoding]];
|
|
|
+// NSString * aString = [NSString stringWithUTF8String:game->getGameDataStr().c_str()];
|
|
|
+//// NSLog(@"剑波需要的数据1 %@",string);
|
|
|
+//// NSLog(@"剑波需要的数据2 %@",aString);
|
|
|
+// return aString;
|
|
|
+//
|
|
|
+//}
|
|
|
+//
|
|
|
+//-(void)GameProcessBuf:(uint8_t*)buff length:(int)length{
|
|
|
+//
|
|
|
+// game->GameProcessBuf(buff, length);
|
|
|
+//
|
|
|
+//}
|
|
|
+//
|
|
|
+///// 向外提供,手动释放
|
|
|
+//- (void)handRelease{
|
|
|
+// delete game;
|
|
|
+//}
|
|
|
+//- (void)dealloc{
|
|
|
+// delete game;
|
|
|
+//}
|
|
|
+//
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@interface RunGameObjc ()
|
|
|
//{
|
|
|
// @private
|
|
|
-// OriginTraj * originTraj;
|
|
|
+// RunGame * runGame;
|
|
|
//}
|
|
|
//@end
|
|
|
-//@implementation OriginTrajObj
|
|
|
+//
|
|
|
+//@implementation RunGameObjc
|
|
|
//- (instancetype)init{
|
|
|
// self = [super init];
|
|
|
-// if (self){
|
|
|
-// originTraj = new OriginTraj();
|
|
|
+// if (self) {
|
|
|
+// runGame = new RunGame();
|
|
|
+// }
|
|
|
+// return self;
|
|
|
+//}
|
|
|
+//- (int)getResultLeftRight:(int *)pos
|
|
|
+// devNum:(short)devNum{
|
|
|
+// return runGame->getResultLeftRight(pos, devNum);
|
|
|
+//}
|
|
|
+//- (int)getResultJump:(short)jump{
|
|
|
+// return runGame->getResultJump(jump);
|
|
|
+//}
|
|
|
+//- (int)getResultDown:(short)down{
|
|
|
+// return runGame->getResultDown(down);
|
|
|
+//}
|
|
|
+//- (void)setResultConLeft:(short)zupt{
|
|
|
+// runGame->setResultConLeft(zupt);
|
|
|
+//}
|
|
|
+//- (void)setResultConRight:(short)zupt{
|
|
|
+// runGame->setResultConRight(zupt);
|
|
|
+//}
|
|
|
+//- (int)getResultLeft:(int *)pos girl_shoes:(int)girl_shoes{
|
|
|
+// return runGame->getResultLeft(pos,girl_shoes);
|
|
|
+//}
|
|
|
+//- (int)getResultRight:(int *)pos girl_shoes:(int)girl_shoes{
|
|
|
+// return runGame->getResultRight(pos,girl_shoes);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)process:(int)timeStamp
|
|
|
+// rightPos:(int *)rightPos
|
|
|
+// rightAtt:(int *)rightAtt
|
|
|
+// rightAcc:(int *)rightAcc
|
|
|
+// rightZupt:(int)rightZupt
|
|
|
+// right_press:(int)right_press
|
|
|
+// leftPos:(int *)leftPos
|
|
|
+// leftAtt:(int *)leftAtt
|
|
|
+// leftAcc:(int *)leftAcc
|
|
|
+// leftZupt:(int)leftZupt
|
|
|
+// left_press:(int)left_press
|
|
|
+// jump:(int)jump
|
|
|
+// down:(int)down
|
|
|
+// girl_shoes:(int)girl_shoes{
|
|
|
+//
|
|
|
+// runGame->Process(rightPos, rightAtt, rightAcc,rightZupt,right_press,leftPos, leftAtt, leftAcc,leftZupt, left_press,jump,down,girl_shoes);
|
|
|
+//
|
|
|
+//// Process(int* right_pos, int* right_att, int* right_acc, int right_zupt, int right_press,
|
|
|
+//// int* left_pos, int* left_att, int* left_acc, int left_zupt, int left_press,
|
|
|
+//// int jump, int down, int girl_shoes)
|
|
|
+//
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)getResult:(int *)dec{
|
|
|
+// runGame->getResult(dec);
|
|
|
+//}
|
|
|
+//
|
|
|
+///// 向外提供,手动释放
|
|
|
+//- (void)handRelease{
|
|
|
+// delete runGame;
|
|
|
+//}
|
|
|
+//- (void)dealloc{
|
|
|
+// delete runGame;
|
|
|
+//}
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@interface DanceGameObjc()
|
|
|
+//{
|
|
|
+//@private
|
|
|
+// DanceGame *danceGame;
|
|
|
+//}
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@implementation DanceGameObjc
|
|
|
+//- (instancetype)init{
|
|
|
+// self = [super init];
|
|
|
+// if (self) {
|
|
|
+// danceGame = new DanceGame();
|
|
|
// }
|
|
|
// return self;
|
|
|
//}
|
|
|
//
|
|
|
-//- (void)process:(int*)right_pos
|
|
|
-// right_att:(int*)right_att
|
|
|
-// right_zupt:(int)right_zupt
|
|
|
-// left_pos:(int*)left_pos
|
|
|
-// left_att:(int*)left_att
|
|
|
-// left_zupt:(int) left_zupt{
|
|
|
-// originTraj->Process(right_pos, right_att, right_zupt, left_pos, left_att, left_zupt);
|
|
|
+////- (int)gamePositionProcess:(int *)pos
|
|
|
+//// stepPos:(int *)stepPos
|
|
|
+//// rssi:(int)rssi
|
|
|
+//// hostOrSlave:(short)hostOrSlave{
|
|
|
+//// //SInt16 ==> short*
|
|
|
+//// return danceGame->game_position_process(pos, stepPos, rssi, hostOrSlave);
|
|
|
+////}
|
|
|
+//
|
|
|
+////- (void)gameBoundary:(int *)globalPos{
|
|
|
+//// danceGame->game_boundary(globalPos);
|
|
|
+////}
|
|
|
+////- (int)getDirectionFloat:(float *)pos
|
|
|
+//// rssi:(int)rssi{
|
|
|
+//// //float==>32位
|
|
|
+//// return danceGame->getDirectionFloat(pos,rssi);
|
|
|
+////}
|
|
|
+////- (short)danceGameProcess:(int *)pos
|
|
|
+//// zupt:(short)zupt
|
|
|
+//// rssi:(int)rssi
|
|
|
+//// hostOrSlave:(short)hostOrSlave{
|
|
|
+//// return danceGame->dance_game_process(pos, zupt, rssi, hostOrSlave);
|
|
|
+////}
|
|
|
+//
|
|
|
+//- (void)process:(int *)rightPos
|
|
|
+// rightAtt:(int *)rightAtt
|
|
|
+// rightAcc:(int *)rightAcc
|
|
|
+// rightZupt:(int)rightZupt
|
|
|
+// right_press:(int)right_press
|
|
|
+// leftPos:(int *)leftPos
|
|
|
+// leftAtt:(int *)leftAtt
|
|
|
+// leftAcc:(int *)leftAcc
|
|
|
+// leftZupt:(int)leftZupt
|
|
|
+// left_press:(int)left_press
|
|
|
+// jump:(int)jump
|
|
|
+// down:(int)down
|
|
|
+// rssi:(int)rssi{
|
|
|
+// danceGame->Process(rightPos, rightAtt,rightAcc, rightZupt, right_press,leftPos, leftAtt,leftAtt, leftZupt, left_press,jump, down, rssi);
|
|
|
+//}
|
|
|
+//
|
|
|
+//- (void)getResult:(int *)matrix{
|
|
|
+// danceGame->getResult(matrix);
|
|
|
+//}
|
|
|
+////- (float)getRssiDistance:(int)rssi{
|
|
|
+//// return danceGame->getRssiDistance(rssi);
|
|
|
+////}
|
|
|
+////- (int)savePosAndRssi:(int *)pos
|
|
|
+//// zupt:(short)zupt
|
|
|
+//// rssi:(int)rssi
|
|
|
+//// hostOrSlave:(short)hostOrSlave{
|
|
|
+//// return danceGame->savePosAndRssi(pos, zupt, rssi, hostOrSlave);
|
|
|
+////}
|
|
|
+///// 向外提供,手动释放
|
|
|
+//- (void)handRelease{
|
|
|
+// delete danceGame;
|
|
|
+//}
|
|
|
+//- (void)dealloc{
|
|
|
+// delete danceGame;
|
|
|
+//}
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@interface FootStepObjc ()
|
|
|
+//{
|
|
|
+//@private
|
|
|
+// FootStep *footStep;
|
|
|
//}
|
|
|
+//@end
|
|
|
//
|
|
|
-//- (float)getGamePos:(int)left_or_right
|
|
|
-// index:(int)index{
|
|
|
-// return originTraj->getGamePos(left_or_right, index);
|
|
|
+//@implementation FootStepObjc
|
|
|
+//
|
|
|
+//- (instancetype)init{
|
|
|
+// self = [super init];
|
|
|
+// if (self) {
|
|
|
+// footStep = new FootStep();
|
|
|
+// }
|
|
|
+// return self;
|
|
|
+//}
|
|
|
+////pos开辟3个空间
|
|
|
+////- (void)stepCal:(int)timeStamp posList:(int *)pos zupt:(int)zupt girl_shoes:(int)girl_shoes{
|
|
|
+// footStep->stepCal(timeStamp, pos, zupt,girl_shoes);
|
|
|
+//}
|
|
|
+//- (int)getStepFreq{
|
|
|
+// return footStep->getStepFreq();
|
|
|
+//}
|
|
|
+//- (int)getStepStatus{
|
|
|
+// return footStep->getStepStatus();
|
|
|
+//}
|
|
|
+//- (int)getStepCount{
|
|
|
+// return footStep->getStepCount();
|
|
|
+//}
|
|
|
+//- (void)dealloc{
|
|
|
+// delete footStep;
|
|
|
+//}
|
|
|
+///// 向外提供,手动释放
|
|
|
+//- (void)handRelease{
|
|
|
+// delete footStep;
|
|
|
//}
|
|
|
//
|
|
|
+//@end
|
|
|
+//
|
|
|
+//@interface InertialTrajProcessObjc ()
|
|
|
+//{
|
|
|
+// @private
|
|
|
+// InertialTrajProcess * inertialTrajProcess;
|
|
|
+//}
|
|
|
+//@end
|
|
|
+//@implementation InertialTrajProcessObjc
|
|
|
+//- (instancetype)init{
|
|
|
+// self = [super init];
|
|
|
+// if (self) {
|
|
|
+// inertialTrajProcess = new InertialTrajProcess();
|
|
|
+// }
|
|
|
+// return self;
|
|
|
+//}
|
|
|
+//- (void)trajRotate:(int *)pos{
|
|
|
+// inertialTrajProcess->TrajRotate(pos);
|
|
|
+//}
|
|
|
+////rotateMatrix只能开辟4个空间
|
|
|
+//- (void)trajRotate:(int *)pos
|
|
|
+// rotateMatrix:(float *)rotateMatrix{
|
|
|
+// inertialTrajProcess->TrajRotate(pos,rotateMatrix);
|
|
|
+//}
|
|
|
+//- (void)resetHeading:(short)heading{
|
|
|
+// inertialTrajProcess->ResetHeading(heading);
|
|
|
+//}
|
|
|
///// 向外提供,手动释放
|
|
|
//- (void)handRelease{
|
|
|
-// delete originTraj;
|
|
|
+// delete inertialTrajProcess;
|
|
|
//}
|
|
|
//- (void)dealloc{
|
|
|
-// delete originTraj;
|
|
|
+// delete inertialTrajProcess;
|
|
|
//}
|
|
|
//@end
|
|
|
+//
|
|
|
+//
|
|
|
+////@interface OriginTrajObj ()
|
|
|
+////{
|
|
|
+//// @private
|
|
|
+//// OriginTraj * originTraj;
|
|
|
+////}
|
|
|
+////@end
|
|
|
+////@implementation OriginTrajObj
|
|
|
+////- (instancetype)init{
|
|
|
+//// self = [super init];
|
|
|
+//// if (self){
|
|
|
+//// originTraj = new OriginTraj();
|
|
|
+//// }
|
|
|
+//// return self;
|
|
|
+////}
|
|
|
+////
|
|
|
+////- (void)process:(int*)right_pos
|
|
|
+//// right_att:(int*)right_att
|
|
|
+//// right_zupt:(int)right_zupt
|
|
|
+//// left_pos:(int*)left_pos
|
|
|
+//// left_att:(int*)left_att
|
|
|
+//// left_zupt:(int) left_zupt{
|
|
|
+//// originTraj->Process(right_pos, right_att, right_zupt, left_pos, left_att, left_zupt);
|
|
|
+////}
|
|
|
+////
|
|
|
+////- (float)getGamePos:(int)left_or_right
|
|
|
+//// index:(int)index{
|
|
|
+//// return originTraj->getGamePos(left_or_right, index);
|
|
|
+////}
|
|
|
+////
|
|
|
+/////// 向外提供,手动释放
|
|
|
+////- (void)handRelease{
|
|
|
+//// delete originTraj;
|
|
|
+////}
|
|
|
+////- (void)dealloc{
|
|
|
+//// delete originTraj;
|
|
|
+////}
|
|
|
+////@end
|