mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:44:02 +02:00
Fix for eyelids, change Faceshift menu option to indicate that it applies
specifically to TCP connection.
This commit is contained in:
parent
4b19e3d0fe
commit
feecb4fa25
5 changed files with 12 additions and 12 deletions
|
@ -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);
|
||||
|
|
|
@ -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";
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -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()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
Loading…
Reference in a new issue