mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 17:14:59 +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();
|
||||
_eyePosition = calculateAverageEyePosition();
|
||||
|
||||
if (!billboard && _owningAvatar) {
|
||||
auto skeletonModel = static_cast<Avatar*>(_owningAvatar)->getSkeletonModel();
|
||||
if (skeletonModel) {
|
||||
skeletonModel->getEyePositions(_leftEyePosition, _rightEyePosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void Head::calculateMouthShapes() {
|
||||
|
|
|
@ -897,7 +897,9 @@ void MyAvatar::updateLookAtTargetAvatar() {
|
|||
// Scale by proportional differences between avatar and human.
|
||||
float humanEyeSeparationInModelSpace = glm::length(humanLeftEye - humanRightEye) * ipdScale;
|
||||
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.
|
||||
|
|
Loading…
Reference in a new issue