mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 13:56:24 +02:00
Avatar: Eye-tracking works again
This replaces the calculation of the Head left and right eye positions used for eye tracking.
Which was inadvertently removed in this commit 7483b8546b
This commit is contained in:
parent
17a2ed7dd0
commit
6a5a443eff
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