Fix for eyelids, change Faceshift menu option to indicate that it applies

specifically to TCP connection.
This commit is contained in:
Andrzej Kapolka 2013-09-11 10:44:38 -07:00
parent 4b19e3d0fe
commit feecb4fa25
5 changed files with 12 additions and 12 deletions

View file

@ -370,11 +370,11 @@ Menu::Menu() :
SLOT(setDepthOnly(bool))); SLOT(setDepthOnly(bool)));
addCheckableActionToQMenuAndActionHash(developerMenu, addCheckableActionToQMenuAndActionHash(developerMenu,
MenuOption::Faceshift, MenuOption::FaceshiftTCP,
0, 0,
false, false,
appInstance->getFaceshift(), appInstance->getFaceshift(),
SLOT(setEnabled(bool))); SLOT(setTCPEnabled(bool)));
QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools"); QMenu* audioDebugMenu = developerMenu->addMenu("Audio Debugging Tools");
addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoAudio); addCheckableActionToQMenuAndActionHash(audioDebugMenu, MenuOption::EchoAudio);

View file

@ -137,7 +137,7 @@ namespace MenuOption {
const QString ExportVoxels = "Export Voxels"; const QString ExportVoxels = "Export Voxels";
const QString HeadMouse = "Head Mouse"; const QString HeadMouse = "Head Mouse";
const QString FaceMode = "Cycle Face Mode"; const QString FaceMode = "Cycle Face Mode";
const QString Faceshift = "Faceshift"; const QString FaceshiftTCP = "Faceshift (TCP)";
const QString FalseColorByDistance = "FALSE Color By Distance"; const QString FalseColorByDistance = "FALSE Color By Distance";
const QString FalseColorBySource = "FALSE Color By Source"; const QString FalseColorBySource = "FALSE Color By Source";
const QString FalseColorEveryOtherVoxel = "FALSE Color Every Other Randomly"; const QString FalseColorEveryOtherVoxel = "FALSE Color Every Other Randomly";

View file

@ -726,7 +726,7 @@ void Head::renderEyeBalls() {
float angle = -67.5f - 50.0f * _leftEyeBlink; float angle = -67.5f - 50.0f * _leftEyeBlink;
glRotatef(angle, 1, 0, 0); glRotatef(angle, 1, 0, 0);
Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); 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); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10);
} }
glPopMatrix(); glPopMatrix();
@ -740,7 +740,7 @@ void Head::renderEyeBalls() {
float angle = -67.5f - 50.0f * _rightEyeBlink; float angle = -67.5f - 50.0f * _rightEyeBlink;
glRotatef(angle, 1, 0, 0); glRotatef(angle, 1, 0, 0);
Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10); 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); Application::getInstance()->getGeometryCache()->renderHemisphere(15, 10);
} }
glPopMatrix(); glPopMatrix();

View file

@ -18,7 +18,7 @@ using namespace std;
const quint16 FACESHIFT_PORT = 33433; const quint16 FACESHIFT_PORT = 33433;
Faceshift::Faceshift() : Faceshift::Faceshift() :
_enabled(false), _tcpEnabled(false),
_lastMessageReceived(0), _lastMessageReceived(0),
_eyeGazeLeftPitch(0.0f), _eyeGazeLeftPitch(0.0f),
_eyeGazeLeftYaw(0.0f), _eyeGazeLeftYaw(0.0f),
@ -75,8 +75,8 @@ void Faceshift::reset() {
} }
} }
void Faceshift::setEnabled(bool enabled) { void Faceshift::setTCPEnabled(bool enabled) {
if ((_enabled = enabled)) { if ((_tcpEnabled = enabled)) {
connectSocket(); connectSocket();
} else { } else {
@ -85,7 +85,7 @@ void Faceshift::setEnabled(bool enabled) {
} }
void Faceshift::connectSocket() { void Faceshift::connectSocket() {
if (_enabled) { if (_tcpEnabled) {
qDebug("Faceshift: Connecting...\n"); qDebug("Faceshift: Connecting...\n");
_tcpSocket.connectToHost("localhost", FACESHIFT_PORT); _tcpSocket.connectToHost("localhost", FACESHIFT_PORT);
@ -106,7 +106,7 @@ void Faceshift::noteError(QAbstractSocket::SocketError error) {
qDebug() << "Faceshift: " << _tcpSocket.errorString() << "\n"; qDebug() << "Faceshift: " << _tcpSocket.errorString() << "\n";
// reconnect after a delay // reconnect after a delay
if (_enabled) { if (_tcpEnabled) {
QTimer::singleShot(1000, this, SLOT(connectSocket())); QTimer::singleShot(1000, this, SLOT(connectSocket()));
} }
} }

View file

@ -51,7 +51,7 @@ public:
public slots: public slots:
void setEnabled(bool enabled); void setTCPEnabled(bool enabled);
private slots: private slots:
@ -69,7 +69,7 @@ private:
QTcpSocket _tcpSocket; QTcpSocket _tcpSocket;
QUdpSocket _udpSocket; QUdpSocket _udpSocket;
fs::fsBinaryStream _stream; fs::fsBinaryStream _stream;
bool _enabled; bool _tcpEnabled;
bool _tracking; bool _tracking;
uint64_t _lastMessageReceived; uint64_t _lastMessageReceived;