mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 19:59:28 +02:00
Merge pull request #7469 from hyperlogic/tony/eye-tracking-fix
Avatar: Eye-tracking works again
This commit is contained in:
commit
f000ef6158
2 changed files with 10 additions and 1 deletions
|
@ -231,6 +231,13 @@ void Head::simulate(float deltaTime, bool isMine, bool billboard) {
|
||||||
|
|
||||||
_leftEyePosition = _rightEyePosition = getPosition();
|
_leftEyePosition = _rightEyePosition = getPosition();
|
||||||
_eyePosition = calculateAverageEyePosition();
|
_eyePosition = calculateAverageEyePosition();
|
||||||
|
|
||||||
|
if (!billboard && _owningAvatar) {
|
||||||
|
auto skeletonModel = static_cast<Avatar*>(_owningAvatar)->getSkeletonModel();
|
||||||
|
if (skeletonModel) {
|
||||||
|
skeletonModel->getEyePositions(_leftEyePosition, _rightEyePosition);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void Head::calculateMouthShapes() {
|
void Head::calculateMouthShapes() {
|
||||||
|
|
|
@ -897,7 +897,9 @@ void MyAvatar::updateLookAtTargetAvatar() {
|
||||||
// Scale by proportional differences between avatar and human.
|
// Scale by proportional differences between avatar and human.
|
||||||
float humanEyeSeparationInModelSpace = glm::length(humanLeftEye - humanRightEye) * ipdScale;
|
float humanEyeSeparationInModelSpace = glm::length(humanLeftEye - humanRightEye) * ipdScale;
|
||||||
float avatarEyeSeparation = glm::length(avatarLeftEye - avatarRightEye);
|
float avatarEyeSeparation = glm::length(avatarLeftEye - avatarRightEye);
|
||||||
gazeOffset = gazeOffset * humanEyeSeparationInModelSpace / avatarEyeSeparation;
|
if (avatarEyeSeparation > 0.0f) {
|
||||||
|
gazeOffset = gazeOffset * humanEyeSeparationInModelSpace / avatarEyeSeparation;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// And now we can finally add that offset to the camera.
|
// And now we can finally add that offset to the camera.
|
||||||
|
|
Loading…
Reference in a new issue