summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_ft
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2013-04-13 05:45:07 +0200
committerStanislaw Halik <sthalik@misaki.pl>2013-04-13 05:45:07 +0200
commit351e844f6a3c5484acfcf4fb0154bcab6f1780a0 (patch)
treee2b1fcb041ae3b763120e3ffb134d529006b0cb2 /ftnoir_protocol_ft
parent29cf8b9ddf89a42d72ca1c0fbdc9fa93f0c5d189 (diff)
Don't use axes as class/struct members. Use an array instead, and iterate over them where applicable.
Diffstat (limited to 'ftnoir_protocol_ft')
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft.cpp28
-rw-r--r--ftnoir_protocol_ft/ftnoir_protocol_ft.h2
2 files changed, 15 insertions, 15 deletions
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
index bd9b7746..99525c90 100644
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
+++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.cpp
@@ -208,7 +208,7 @@ void FTNoIR_Protocol::loadSettings() {
//
// Update Headpose in Game.
//
-void FTNoIR_Protocol::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) {
+void FTNoIR_Protocol::sendHeadposeToGame(double *headpose, double *rawheadpose ) {
float virtPosX;
float virtPosY;
float virtPosZ;
@@ -228,19 +228,19 @@ float headRotZ;
//
// Scale the Raw measurements to the client measurements.
//
- headRotX = getRadsFromDegrees(headpose->pitch);
- headRotY = getRadsFromDegrees(headpose->yaw);
- headRotZ = getRadsFromDegrees(headpose->roll);
- headPosX = headpose->x * 10;
- headPosY = headpose->y * 10;
- headPosZ = headpose->z * 10;
-
- virtRotX = getRadsFromDegrees(headpose->pitch);
- virtRotY = getRadsFromDegrees(headpose->yaw);
- virtRotZ = getRadsFromDegrees(headpose->roll);
- virtPosX = headpose->x * 10;
- virtPosY = headpose->y * 10;
- virtPosZ = headpose->z * 10;
+ headRotX = getRadsFromDegrees(headpose[RY]);
+ headRotY = getRadsFromDegrees(headpose[RX]);
+ headRotZ = getRadsFromDegrees(headpose[RZ]);
+ headPosX = headpose[TX] * 10;
+ headPosY = headpose[TY] * 10;
+ headPosZ = headpose[TZ] * 10;
+
+ virtRotX = getRadsFromDegrees(headpose[RY]);
+ virtRotY = getRadsFromDegrees(headpose[RX]);
+ virtRotZ = getRadsFromDegrees(headpose[RZ]);
+ virtPosX = headpose[TX] * 10;
+ virtPosY = headpose[TY] * 10;
+ virtPosZ = headpose[TZ] * 10;
//
// Check if the pointer is OK and wait for the Mutex.
diff --git a/ftnoir_protocol_ft/ftnoir_protocol_ft.h b/ftnoir_protocol_ft/ftnoir_protocol_ft.h
index 15ee5149..526a6aea 100644
--- a/ftnoir_protocol_ft/ftnoir_protocol_ft.h
+++ b/ftnoir_protocol_ft/ftnoir_protocol_ft.h
@@ -55,7 +55,7 @@ public:
void Initialize();
bool checkServerInstallationOK( );
- void sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose );
+ void sendHeadposeToGame( double *headpose, double *rawheadpose );
void getNameFromGame( char *dest ); // Take care dest can handle up to 100 chars...
private: