mirror of
https://github.com/overte-org/overte.git
synced 2025-04-19 15:03:53 +02:00
Incorporate the "eye open" coefficients for eye widening.
This commit is contained in:
parent
b9878bbbd6
commit
4b19e3d0fe
2 changed files with 15 additions and 3 deletions
|
@ -28,6 +28,8 @@ Faceshift::Faceshift() :
|
|||
_rightBlink(0.0f),
|
||||
_leftBlinkIndex(0), // see http://support.faceshift.com/support/articles/35129-export-of-blendshapes
|
||||
_rightBlinkIndex(1),
|
||||
_leftEyeOpenIndex(8),
|
||||
_rightEyeOpenIndex(9),
|
||||
_browHeight(0.0f),
|
||||
_browUpCenterIndex(16),
|
||||
_mouthSize(0.0f),
|
||||
|
@ -144,11 +146,12 @@ void Faceshift::receive(const QByteArray& buffer) {
|
|||
_eyeGazeRightPitch = -data.m_eyeGazeRightPitch;
|
||||
_eyeGazeRightYaw = data.m_eyeGazeRightYaw;
|
||||
|
||||
const float EYE_OPEN_SCALE = 0.25f;
|
||||
if (_leftBlinkIndex != -1) {
|
||||
_leftBlink = data.m_coeffs[_leftBlinkIndex];
|
||||
_leftBlink = data.m_coeffs[_leftBlinkIndex] - data.m_coeffs[_leftEyeOpenIndex] * EYE_OPEN_SCALE;
|
||||
}
|
||||
if (_rightBlinkIndex != -1) {
|
||||
_rightBlink = data.m_coeffs[_rightBlinkIndex];
|
||||
_rightBlink = data.m_coeffs[_rightBlinkIndex] - data.m_coeffs[_rightEyeOpenIndex] * EYE_OPEN_SCALE;
|
||||
}
|
||||
if (_browUpCenterIndex != -1) {
|
||||
_browHeight = data.m_coeffs[_browUpCenterIndex];
|
||||
|
@ -167,7 +170,13 @@ void Faceshift::receive(const QByteArray& buffer) {
|
|||
|
||||
} else if (names[i] == "EyeBlink_R") {
|
||||
_rightBlinkIndex = i;
|
||||
|
||||
|
||||
} else if (names[i] == "EyeOpen_L") {
|
||||
_leftEyeOpenIndex = i;
|
||||
|
||||
} else if (names[i] == "EyeOpen_R") {
|
||||
_rightEyeOpenIndex = i;
|
||||
|
||||
} else if (names[i] == "BrowsU_C") {
|
||||
_browUpCenterIndex = i;
|
||||
|
||||
|
|
|
@ -88,6 +88,9 @@ private:
|
|||
int _leftBlinkIndex;
|
||||
int _rightBlinkIndex;
|
||||
|
||||
int _leftEyeOpenIndex;
|
||||
int _rightEyeOpenIndex;
|
||||
|
||||
float _browHeight;
|
||||
|
||||
int _browUpCenterIndex;
|
||||
|
|
Loading…
Reference in a new issue