diff --git a/interface/src/Menu.cpp b/interface/src/Menu.cpp index 1d9e12cc96..7e9dfe2355 100644 --- a/interface/src/Menu.cpp +++ b/interface/src/Menu.cpp @@ -370,11 +370,11 @@ Menu::Menu() : SLOT(setDepthOnly(bool))); addCheckableActionToQMenuAndActionHash(developerMenu, - MenuOption::Faceshift, + MenuOption::FaceshiftTCP, 0, false, appInstance->getFaceshift(), - SLOT(setEnabled(bool))); + SLOT(setTCPEnabled(bool))); QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools"); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoAudio); diff --git a/interface/src/Menu.h b/interface/src/Menu.h index 934cb1b7ae..2f486da031 100644 --- a/interface/src/Menu.h +++ b/interface/src/Menu.h @@ -137,7 +137,7 @@ namespace MenuOption { const QString ExportVoxels = "Export Voxels"; const QString HeadMouse = "Head Mouse"; const QString FaceMode = "Cycle Face Mode"; - const QString Faceshift = "Faceshift"; + const QString FaceshiftTCP = "Faceshift (TCP)"; const QString FalseColorByDistance = "FALSE Color By Distance"; const QString FalseColorBySource = "FALSE Color By Source"; const QString FalseColorEveryOtherVoxel = "FALSE Color Every Other Randomly"; diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index 517d062494..b439d56568 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -726,7 +726,7 @@ void Head::renderEyeBalls() { float angle = -67.5f - 50.0f * _leftEyeBlink; glRotatef(angle, 1, 0, 0); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); - glRotatef(glm::mix(-angle, 180.0f, _leftEyeBlink), 1, 0, 0); + glRotatef(glm::mix(-angle, 180.0f, max(0.0f, _leftEyeBlink)), 1, 0, 0); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); } glPopMatrix(); @@ -740,7 +740,7 @@ void Head::renderEyeBalls() { float angle = -67.5f - 50.0f * _rightEyeBlink; glRotatef(angle, 1, 0, 0); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); - glRotatef(glm::mix(-angle, 180.0f, _rightEyeBlink), 1, 0, 0); + glRotatef(glm::mix(-angle, 180.0f, max(0.0f, _rightEyeBlink)), 1, 0, 0); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); } glPopMatrix(); diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index 5da06ae912..4bcab43cf3 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -18,7 +18,7 @@ using namespace std; const quint16 FACESHIFT_PORT = 33433; Faceshift::Faceshift() : - _enabled(false), + _tcpEnabled(false), _lastMessageReceived(0), _eyeGazeLeftPitch(0.0f), _eyeGazeLeftYaw(0.0f), @@ -75,8 +75,8 @@ void Faceshift::reset() { } } -void Faceshift::setEnabled(bool enabled) { - if ((_enabled = enabled)) { +void Faceshift::setTCPEnabled(bool enabled) { + if ((_tcpEnabled = enabled)) { connectSocket(); } else { @@ -85,7 +85,7 @@ void Faceshift::setEnabled(bool enabled) { } void Faceshift::connectSocket() { - if (_enabled) { + if (_tcpEnabled) { qDebug("Faceshift: Connecting...\n"); _tcpSocket.connectToHost("localhost", FACESHIFT_PORT); @@ -106,7 +106,7 @@ void Faceshift::noteError(QAbstractSocket::SocketError error) { qDebug() << "Faceshift: " << _tcpSocket.errorString() << "\n"; // reconnect after a delay - if (_enabled) { + if (_tcpEnabled) { QTimer::singleShot(1000, this, SLOT(connectSocket())); } } diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index 1bdb0cde59..29a25f9c4c 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -51,7 +51,7 @@ public: public slots: - void setEnabled(bool enabled); + void setTCPEnabled(bool enabled); private slots: @@ -69,7 +69,7 @@ private: QTcpSocket _tcpSocket; QUdpSocket _udpSocket; fs::fsBinaryStream _stream; - bool _enabled; + bool _tcpEnabled; bool _tracking; uint64_t _lastMessageReceived;