From 58cf51058b61b7440fa5ef38bd5251a6edb74ee6 Mon Sep 17 00:00:00 2001 From: Seth Alves Date: Tue, 17 Sep 2019 09:42:26 -0700 Subject: [PATCH] code review --- interface/src/avatar/MyHead.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/interface/src/avatar/MyHead.cpp b/interface/src/avatar/MyHead.cpp index b5e8bc2171..1fc134169a 100644 --- a/interface/src/avatar/MyHead.cpp +++ b/interface/src/avatar/MyHead.cpp @@ -15,6 +15,7 @@ #include #include #include +#include #include "devices/DdeFaceTracker.h" #include "Application.h" @@ -45,6 +46,11 @@ void MyHead::simulate(float deltaTime) { auto player = DependencyManager::get(); // Only use face trackers when not playing back a recording. if (!player->isPlaying()) { + // TODO -- finish removing face-tracker specific code. To do this, add input channels for + // each blendshape-coefficient and update the various json files to relay them in a useful way. + // After that, input plugins can be used to drive the avatar's face, and the various "DDE" files + // can be ported into the plugin and removed. + // // auto faceTracker = qApp->getActiveFaceTracker(); // const bool hasActualFaceTrackerConnected = faceTracker && !faceTracker->isMuted(); // _isFaceTrackerConnected = hasActualFaceTrackerConnected || _owningAvatar->getHasScriptedBlendshapes(); @@ -63,13 +69,13 @@ void MyHead::simulate(float deltaTime) { float leftEyeBlink = userInputMapper->getActionState(controller::Action::LEFT_EYE_BLINK); float rightEyeBlink = userInputMapper->getActionState(controller::Action::RIGHT_EYE_BLINK); _blendshapeCoefficients.resize(std::max(_blendshapeCoefficients.size(), 2)); - _blendshapeCoefficients[0] = leftEyeBlink; - _blendshapeCoefficients[1] = rightEyeBlink; + _blendshapeCoefficients[EYE_BLINK_L_INDEX] = leftEyeBlink; + _blendshapeCoefficients[EYE_BLINK_R_INDEX] = rightEyeBlink; } else { const float FULLY_OPEN = 0.0f; _blendshapeCoefficients.resize(std::max(_blendshapeCoefficients.size(), 2)); - _blendshapeCoefficients[0] = FULLY_OPEN; - _blendshapeCoefficients[1] = FULLY_OPEN; + _blendshapeCoefficients[EYE_BLINK_L_INDEX] = FULLY_OPEN; + _blendshapeCoefficients[EYE_BLINK_R_INDEX] = FULLY_OPEN; } } Parent::simulate(deltaTime);