From b2a99edb2e76b68eb2c55c40dc3e391cf99e3d7c Mon Sep 17 00:00:00 2001 From: Stephen Birarda Date: Fri, 18 Jul 2014 14:27:20 -0700 Subject: [PATCH] fix conditional builds without Faceshift --- interface/src/devices/Faceshift.cpp | 25 +++++++++++++++++++++++++ interface/src/devices/Faceshift.h | 9 ++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index a7d50814e2..07e394f63f 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -19,11 +19,16 @@ #include "Menu.h" #include "Util.h" +#ifdef HAVE_FACESHIFT using namespace fs; +#endif + using namespace std; const quint16 FACESHIFT_PORT = 33433; +#ifdef HAVE_FACESHIFT + Faceshift::Faceshift() : _tcpEnabled(true), _tcpRetryCount(0), @@ -72,6 +77,24 @@ bool Faceshift::isActive() const { return (usecTimestampNow() - _lastTrackingStateReceived) < ACTIVE_TIMEOUT_USECS; } +#else + +Faceshift::Faceshift() { + +} + +bool Faceshift::isConnectedOrConnecting() const { + return false; +} + +bool Faceshift::isActive() const { + return false; +} + +#endif + +#ifdef HAVE_FACESHIFT + void Faceshift::update() { if (!isActive()) { return; @@ -260,3 +283,5 @@ void Faceshift::receive(const QByteArray& buffer) { } } } + +#endif diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index 2fc1aaddb1..fd46be7567 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -15,8 +15,12 @@ #include #include +#ifdef HAVE_FACESHIFT + #include +#endif + #include "FaceTracker.h" /// Handles interaction with the Faceshift software, which provides head position/orientation and facial features. @@ -24,7 +28,6 @@ class Faceshift : public FaceTracker { Q_OBJECT public: - Faceshift(); void init(); @@ -32,6 +35,8 @@ public: bool isConnectedOrConnecting() const; bool isActive() const; + +#ifdef HAVE_FACESHIFT const glm::vec3& getHeadAngularVelocity() const { return _headAngularVelocity; } @@ -123,6 +128,8 @@ private: float _longTermAverageEyePitch; float _longTermAverageEyeYaw; bool _longTermAverageInitialized; + +#endif // HAVE_FACESHIFT }; #endif // hifi_Faceshift_h