diff options
author | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 10:51:59 +0200 |
---|---|---|
committer | Stanislaw Halik <sthalik@misaki.pl> | 2016-06-09 11:08:40 +0200 |
commit | 091c5bf5ae019e9667ccc5ff0cb74531c740550b (patch) | |
tree | 96ac37290e620dfc68c9fe305e9a01218a5a841b | |
parent | e97094569e06906b88f8578b99e1c59332bb3215 (diff) |
proto/simconnect: float/double promotions
-rw-r--r-- | proto-sc/ftnoir_protocol_sc.cpp | 72 |
1 files changed, 37 insertions, 35 deletions
diff --git a/proto-sc/ftnoir_protocol_sc.cpp b/proto-sc/ftnoir_protocol_sc.cpp index 0c6cb486..8458cc20 100644 --- a/proto-sc/ftnoir_protocol_sc.cpp +++ b/proto-sc/ftnoir_protocol_sc.cpp @@ -58,13 +58,15 @@ void FTNoIR_Protocol::run() } void FTNoIR_Protocol::pose( const double *headpose ) { - virtSCRotX = -headpose[Pitch]; // degrees - virtSCRotY = headpose[Yaw]; - virtSCRotZ = headpose[Roll]; - - virtSCPosX = headpose[TX]/100.f; // cm to meters - virtSCPosY = headpose[TY]/100.f; - virtSCPosZ = -headpose[TZ]/100.f; + // euler degrees + virtSCRotX = float(-headpose[Pitch]); + virtSCRotY = float(headpose[Yaw]); + virtSCRotZ = float(headpose[Roll]); + + // cm to meters + virtSCPosX = float(headpose[TX]/100); + virtSCPosY = float(headpose[TY]/100); + virtSCPosZ = float(-headpose[TZ]/100); } #ifdef __GNUC__ @@ -134,37 +136,37 @@ bool FTNoIR_Protocol::correct() return false; } - simconnect_open = (importSimConnect_Open) SCClientLib.resolve("SimConnect_Open"); - if (simconnect_open == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Open function not found in DLL!"; - return false; - } - simconnect_set6DOF = (importSimConnect_CameraSetRelative6DOF) SCClientLib.resolve("SimConnect_CameraSetRelative6DOF"); - if (simconnect_set6DOF == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CameraSetRelative6DOF function not found in DLL!"; - return false; - } - simconnect_close = (importSimConnect_Close) SCClientLib.resolve("SimConnect_Close"); - if (simconnect_close == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Close function not found in DLL!"; - return false; - } - - simconnect_calldispatch = (importSimConnect_CallDispatch) SCClientLib.resolve("SimConnect_CallDispatch"); - if (simconnect_calldispatch == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CallDispatch function not found in DLL!"; - return false; - } - - simconnect_subscribetosystemevent = (importSimConnect_SubscribeToSystemEvent) SCClientLib.resolve("SimConnect_SubscribeToSystemEvent"); - if (simconnect_subscribetosystemevent == NULL) { - qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_SubscribeToSystemEvent function not found in DLL!"; - return false; - } + simconnect_open = (importSimConnect_Open) SCClientLib.resolve("SimConnect_Open"); + if (simconnect_open == NULL) { + qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Open function not found in DLL!"; + return false; + } + simconnect_set6DOF = (importSimConnect_CameraSetRelative6DOF) SCClientLib.resolve("SimConnect_CameraSetRelative6DOF"); + if (simconnect_set6DOF == NULL) { + qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CameraSetRelative6DOF function not found in DLL!"; + return false; + } + simconnect_close = (importSimConnect_Close) SCClientLib.resolve("SimConnect_Close"); + if (simconnect_close == NULL) { + qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_Close function not found in DLL!"; + return false; + } + + simconnect_calldispatch = (importSimConnect_CallDispatch) SCClientLib.resolve("SimConnect_CallDispatch"); + if (simconnect_calldispatch == NULL) { + qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_CallDispatch function not found in DLL!"; + return false; + } + + simconnect_subscribetosystemevent = (importSimConnect_SubscribeToSystemEvent) SCClientLib.resolve("SimConnect_SubscribeToSystemEvent"); + if (simconnect_subscribetosystemevent == NULL) { + qDebug() << "FTNoIR_Protocol::correct() says: SimConnect_SubscribeToSystemEvent function not found in DLL!"; + return false; + } start(); - return true; + return true; } void FTNoIR_Protocol::handle() |