From 351e844f6a3c5484acfcf4fb0154bcab6f1780a0 Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 13 Apr 2013 05:45:07 +0200 Subject: Don't use axes as class/struct members. Use an array instead, and iterate over them where applicable. --- ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp | 14 ++++++-------- ftnoir_protocol_ftn/ftnoir_protocol_ftn.h | 2 +- 2 files changed, 7 insertions(+), 9 deletions(-) (limited to 'ftnoir_protocol_ftn') diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp index 26f331b3..b8cc0703 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp @@ -77,23 +77,21 @@ void FTNoIR_Protocol::loadSettings() { // // Update Headpose in Game. // -void FTNoIR_Protocol::sendHeadposeToGame( THeadPoseData *headpose, THeadPoseData *rawheadpose ) { -int no_bytes; -THeadPoseData TestData; - +void FTNoIR_Protocol::sendHeadposeToGame(double *headpose, double *rawheadpose ) { + int no_bytes; + double test_data[6]; // // Copy the Raw measurements directly to the client. // - TestData = *headpose; - TestData.frame_number = 0; - + for (int i = 0; i < 6; i++) + test_data[i] = headpose[i]; // // Try to send an UDP-message to the receiver // //! [1] if (outSocket != 0) { - no_bytes = outSocket->writeDatagram((const char *) &TestData, sizeof( TestData ), destIP, destPort); + no_bytes = outSocket->writeDatagram((const char *) test_data, sizeof( test_data ), destIP, destPort); if ( no_bytes > 0) { // qDebug() << "FTNServer::writePendingDatagrams says: bytes send =" << no_bytes << sizeof( double ); } diff --git a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h index 7dca6842..f40f30fa 100644 --- a/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h +++ b/ftnoir_protocol_ftn/ftnoir_protocol_ftn.h @@ -48,7 +48,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: -- cgit v1.2.3