diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index 5c50f76767..dedbbced30 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -1568,9 +1568,9 @@ void Application::init() { qDebug("Loaded settings"); // initialize our face trackers after loading the menu settings - _faceplus.init(); _faceshift.init(); - _visage.init(); + _faceplus.init(); + _visage.init(); // fire off an immediate domain-server check in now that settings are loaded NodeList::getInstance()->sendDomainServerCheckIn(); diff --git a/interface/src/avatar/Head.cpp b/interface/src/avatar/Head.cpp index f42220c0f4..c3cff15c70 100644 --- a/interface/src/avatar/Head.cpp +++ b/interface/src/avatar/Head.cpp @@ -60,17 +60,11 @@ void Head::reset() { void Head::simulate(float deltaTime, bool isMine, bool billboard) { // Update audio trailing average for rendering facial animations - Faceshift* faceshift = Application::getInstance()->getFaceshift(); - Visage* visage = Application::getInstance()->getVisage(); if (isMine) { - _isFaceshiftConnected = false; - if (faceshift->isActive()) { - _blendshapeCoefficients = faceshift->getBlendshapeCoefficients(); - _isFaceshiftConnected = true; - - } else if (visage->isActive()) { - _blendshapeCoefficients = visage->getBlendshapeCoefficients(); - _isFaceshiftConnected = true; + FaceTracker* faceTracker = Application::getInstance()->getActiveFaceTracker(); + if ((_isFaceshiftConnected = faceTracker)) { + _blendshapeCoefficients = faceTracker->getBlendshapeCoefficients(); + _isFaceshiftConnected = true; } } @@ -152,8 +146,9 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) { const float BROW_LIFT_SCALE = 500.0f; const float JAW_OPEN_SCALE = 0.01f; const float JAW_OPEN_DEAD_ZONE = 0.75f; - faceshift->updateFakeCoefficients(_leftEyeBlink, _rightEyeBlink, min(1.0f, _browAudioLift * BROW_LIFT_SCALE), - glm::clamp(sqrt(_averageLoudness * JAW_OPEN_SCALE) - JAW_OPEN_DEAD_ZONE, 0.0f, 1.0f), _blendshapeCoefficients); + Application::getInstance()->getFaceshift()->updateFakeCoefficients(_leftEyeBlink, _rightEyeBlink, + min(1.0f, _browAudioLift * BROW_LIFT_SCALE), glm::clamp(sqrt(_averageLoudness * JAW_OPEN_SCALE) - + JAW_OPEN_DEAD_ZONE, 0.0f, 1.0f), _blendshapeCoefficients); } if (!isMine) { diff --git a/interface/src/devices/Faceplus.cpp b/interface/src/devices/Faceplus.cpp index ccbc494fe3..9a3067e48f 100644 --- a/interface/src/devices/Faceplus.cpp +++ b/interface/src/devices/Faceplus.cpp @@ -44,8 +44,8 @@ static QMultiHash > createChannelNameMap() { blendshapeMap.insert("...", QPair("Mix::BrowsIn_Right", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Left", 1.0f)); blendshapeMap.insert("...", QPair("Mix::BrowsOuterLower_Right", 1.0f)); - blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 1.0f)); - blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 1.0f)); + blendshapeMap.insert("BrowsU_L", QPair("Mix::BrowsUp_Left", 5.0f)); + blendshapeMap.insert("BrowsU_R", QPair("Mix::BrowsUp_Right", 5.0f)); blendshapeMap.insert("EyeOpen_L", QPair("Mix::EyesWide_Left", 1.0f)); blendshapeMap.insert("EyeOpen_R", QPair("Mix::EyesWide_Right", 1.0f)); blendshapeMap.insert("MouthFrown_L", QPair("Mix::Frown_Left", 1.0f)); @@ -102,12 +102,12 @@ void Faceplus::update() { if (!_active) { return; } - if (!(_active = faceplus_current_output_vector(_outputVector.data()))) { + if (!(_active = faceplus_synchronous_track() && faceplus_current_output_vector(_outputVector.data()))) { return; } - _headRotation = glm::quat(glm::radians(_outputVector.at(_headRotationIndices[0]), - _outputVector.at(_headRotationIndices[1]), _outputVector.at(_headRotationIndices[2]))); - _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * 0.5f; + _headRotation = glm::quat(glm::radians(glm::vec3(-_outputVector.at(_headRotationIndices[0]), + _outputVector.at(_headRotationIndices[1]), -_outputVector.at(_headRotationIndices[2])))); + _estimatedEyePitch = (_outputVector.at(_leftEyeRotationIndices[0]) + _outputVector.at(_rightEyeRotationIndices[0])) * -0.5f; _estimatedEyeYaw = (_outputVector.at(_leftEyeRotationIndices[1]) + _outputVector.at(_rightEyeRotationIndices[1])) * 0.5f; qFill(_blendshapeCoefficients.begin(), _blendshapeCoefficients.end(), 0.0f);