Fix for eye pitch, track blinking locally.

This commit is contained in:
Andrzej Kapolka 2013-09-04 10:59:53 -07:00
parent 2c2f2fad5a
commit f84d6f4f37
2 changed files with 36 additions and 29 deletions

View file

@ -192,6 +192,12 @@ void Head::simulate(float deltaTime, bool isMine, float gyroCameraSensitivity) {
_browAudioLift *= 0.7f;
// update eyelid blinking
Faceshift* faceshift = Application::getInstance()->getFaceshift();
if (isMine && faceshift->isActive()) {
_leftEyeBlink = faceshift->getLeftBlink();
_rightEyeBlink = faceshift->getRightBlink();
} else {
const float BLINK_SPEED = 10.0f;
const float FULLY_OPEN = 0.0f;
const float FULLY_CLOSED = 1.0f;
@ -221,6 +227,7 @@ void Head::simulate(float deltaTime, bool isMine, float gyroCameraSensitivity) {
_rightEyeBlinkVelocity = 0.0f;
}
}
}
// based on the nature of the lookat position, determine if the eyes can look / are looking at it.
if (USING_PHYSICAL_MOHAWK) {

View file

@ -71,9 +71,9 @@ void Faceshift::readFromSocket() {
const float TRANSLATION_SCALE = 0.02f;
_headTranslation = glm::vec3(data.m_headTranslation.x, data.m_headTranslation.y,
-data.m_headTranslation.z) * TRANSLATION_SCALE;
_eyeGazeLeftPitch = data.m_eyeGazeLeftPitch;
_eyeGazeLeftPitch = -data.m_eyeGazeLeftPitch;
_eyeGazeLeftYaw = data.m_eyeGazeLeftYaw;
_eyeGazeRightPitch = data.m_eyeGazeRightPitch;
_eyeGazeRightPitch = -data.m_eyeGazeRightPitch;
_eyeGazeRightYaw = data.m_eyeGazeRightYaw;
if (_leftBlinkIndex != -1) {