mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 17:00:13 +02:00
Merge branch 'master' of https://github.com/worklist/hifi into blendface
This commit is contained in:
commit
7d14aaeea4
2 changed files with 5 additions and 5 deletions
|
@ -20,7 +20,7 @@ const quint16 FACESHIFT_PORT = 33433;
|
||||||
|
|
||||||
Faceshift::Faceshift() :
|
Faceshift::Faceshift() :
|
||||||
_tcpEnabled(false),
|
_tcpEnabled(false),
|
||||||
_lastMessageReceived(0),
|
_lastTrackingStateReceived(0),
|
||||||
_eyeGazeLeftPitch(0.0f),
|
_eyeGazeLeftPitch(0.0f),
|
||||||
_eyeGazeLeftYaw(0.0f),
|
_eyeGazeLeftYaw(0.0f),
|
||||||
_eyeGazeRightPitch(0.0f),
|
_eyeGazeRightPitch(0.0f),
|
||||||
|
@ -53,8 +53,7 @@ Faceshift::Faceshift() :
|
||||||
|
|
||||||
bool Faceshift::isActive() const {
|
bool Faceshift::isActive() const {
|
||||||
const uint64_t ACTIVE_TIMEOUT_USECS = 1000000;
|
const uint64_t ACTIVE_TIMEOUT_USECS = 1000000;
|
||||||
return (_tcpSocket.state() == QAbstractSocket::ConnectedState ||
|
return (usecTimestampNow() - _lastTrackingStateReceived) < ACTIVE_TIMEOUT_USECS;
|
||||||
(usecTimestampNow() - _lastMessageReceived) < ACTIVE_TIMEOUT_USECS) && _tracking;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void Faceshift::update() {
|
void Faceshift::update() {
|
||||||
|
@ -153,6 +152,8 @@ void Faceshift::receive(const QByteArray& buffer) {
|
||||||
_eyeGazeRightPitch = -data.m_eyeGazeRightPitch;
|
_eyeGazeRightPitch = -data.m_eyeGazeRightPitch;
|
||||||
_eyeGazeRightYaw = data.m_eyeGazeRightYaw;
|
_eyeGazeRightYaw = data.m_eyeGazeRightYaw;
|
||||||
_blendshapeCoefficients = data.m_coeffs;
|
_blendshapeCoefficients = data.m_coeffs;
|
||||||
|
|
||||||
|
_lastTrackingStateReceived = usecTimestampNow();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -202,5 +203,4 @@ void Faceshift::receive(const QByteArray& buffer) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_lastMessageReceived = usecTimestampNow();
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -85,7 +85,7 @@ private:
|
||||||
fs::fsBinaryStream _stream;
|
fs::fsBinaryStream _stream;
|
||||||
bool _tcpEnabled;
|
bool _tcpEnabled;
|
||||||
bool _tracking;
|
bool _tracking;
|
||||||
uint64_t _lastMessageReceived;
|
uint64_t _lastTrackingStateReceived;
|
||||||
|
|
||||||
glm::quat _headRotation;
|
glm::quat _headRotation;
|
||||||
glm::vec3 _headTranslation;
|
glm::vec3 _headTranslation;
|
||||||
|
|
Loading…
Reference in a new issue