diff options
author | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-10-15 14:07:20 +1100 |
---|---|---|
committer | Donovan Baarda <abo@minkirri.apana.org.au> | 2014-10-15 14:07:20 +1100 |
commit | dbd04e283082ab869a22abf03c4c6280b03935bb (patch) | |
tree | 3951c6f91f76047e655f35e04db4eecd576c49df /ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp | |
parent | d880464fbe9180aefde94594330126e115066dc3 (diff) | |
parent | 051a2e4392bc75b246cc5cb897ae0bbb1f92042e (diff) |
Merge branch 'unstable' of https://github.com/opentrack/opentrack into dev/kalman
Conflicts:
ftnoir_filter_kalman/ftnoir_filter_kalman.h
Diffstat (limited to 'ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp')
-rw-r--r-- | ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp index a3a5cb5f..58fa2ab1 100644 --- a/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp +++ b/ftnoir_protocol_vjoy/ftnoir_protocol_vjoy.cpp @@ -1,22 +1,21 @@ #include "ftnoir_protocol_vjoy.h" -#include "facetracknoir/global-settings.h" -#include <ftnoir_tracker_base/ftnoir_tracker_types.h> +#include "facetracknoir/plugin-api.hpp" -/** constructor **/ FTNoIR_Protocol::FTNoIR_Protocol() { - VJoy_Initialize("", ""); + static char meh[1] = {0}; + VJoy_Initialize(meh, meh); } -/** destructor **/ FTNoIR_Protocol::~FTNoIR_Protocol() { VJoy_Shutdown(); } void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { +#pragma GCC diagnostic ignored "-Wmissing-field-initializers" JOYSTICK_STATE state[2] = { 0 }; - + state[0].POV = (4 << 12) | (4 << 8) | (4 << 4) | 4; state[0].XAxis = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[Yaw] * VJOY_AXIS_MAX / 180.0)); @@ -25,11 +24,11 @@ void FTNoIR_Protocol::sendHeadposeToGame( const double *headpose ) { state[0].XRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TX] * VJOY_AXIS_MAX / 100.0)); state[0].YRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TY] * VJOY_AXIS_MAX / 100.0)); state[0].ZRotation = std::min<int>(VJOY_AXIS_MAX, std::max<int>(VJOY_AXIS_MIN, headpose[TZ] * VJOY_AXIS_MAX / 100.0)); - + VJoy_UpdateJoyState(0, state); } -extern "C" FTNOIR_PROTOCOL_BASE_EXPORT IProtocol* CALLING_CONVENTION GetConstructor() +extern "C" OPENTRACK_EXPORT IProtocol* GetConstructor() { return new FTNoIR_Protocol; } |