summaryrefslogtreecommitdiffhomepage
path: root/ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp
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_ftn/ftnoir_protocol_ftn.cpp
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_ftn/ftnoir_protocol_ftn.cpp')
-rw-r--r--ftnoir_protocol_ftn/ftnoir_protocol_ftn.cpp14
1 files changed, 6 insertions, 8 deletions
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 );
}