diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index c966ed4bf2..a50663b316 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -3077,6 +3077,7 @@ void Application::resetSensors() { _serialHeadSensor.resetAverages(); } _webcam.reset(); + _faceshift.reset(); QCursor::setPos(_headMouseX, _headMouseY); _myAvatar.reset(); _myTransmitter.resetLevels(); diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index 19ef6a8505..e7bb19bee6 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -170,8 +170,10 @@ void Head::simulate(float deltaTime, bool isMine, float gyroCameraSensitivity) { // set these values based on how they'll be used. if we use faceshift in the long term, we'll want a complete // mapping between their blendshape coefficients and our avatar features - _averageLoudness = faceshift->getMouthSize(); - _browAudioLift = faceshift->getBrowHeight(); + const float MOUTH_SIZE_SCALE = 2500.0f; + _averageLoudness = faceshift->getMouthSize() * faceshift->getMouthSize() * MOUTH_SIZE_SCALE; + const float BROW_HEIGHT_SCALE = 0.005f; + _browAudioLift = faceshift->getBrowHeight() * BROW_HEIGHT_SCALE; } else { const float AUDIO_AVERAGING_SECS = 0.05; diff --git a/interface/src/devices/Faceshift.cpp b/interface/src/devices/Faceshift.cpp index fd24696b14..259120e697 100644 --- a/interface/src/devices/Faceshift.cpp +++ b/interface/src/devices/Faceshift.cpp @@ -21,6 +21,14 @@ Faceshift::Faceshift() : _enabled(false), _eyeGazeLeftPitch(0.0f), _eyeGazeLeftY connect(&_socket, SIGNAL(readyRead()), SLOT(readFromSocket())); } +void Faceshift::reset() { + if (isActive()) { + string message; + fsBinaryStream::encode_message(message, fsMsgCalibrateNeutral()); + send(message); + } +} + void Faceshift::setEnabled(bool enabled) { if ((_enabled = enabled)) { connectSocket(); diff --git a/interface/src/devices/Faceshift.h b/interface/src/devices/Faceshift.h index 1b6914b8cf..286a7a56a1 100644 --- a/interface/src/devices/Faceshift.h +++ b/interface/src/devices/Faceshift.h @@ -42,6 +42,8 @@ public: float getMouthSize() const { return _mouthSize; } + void reset(); + public slots: void setEnabled(bool enabled);