mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 02:03:57 +02:00
MyAvatar: take IPD scale into account when computing corrected eye lookAt
This commit is contained in:
parent
3cde972174
commit
babf48ac57
1 changed files with 4 additions and 1 deletions
|
@ -879,8 +879,11 @@ void MyAvatar::updateLookAtTargetAvatar() {
|
|||
glm::vec3 humanLeftEye = humanSystem->getPosition() + (humanSystem->getOrientation() * leftEyeHeadLocal);
|
||||
glm::vec3 humanRightEye = humanSystem->getPosition() + (humanSystem->getOrientation() * rightEyeHeadLocal);
|
||||
|
||||
auto hmdInterface = DependencyManager::get<HMDScriptingInterface>();
|
||||
float ipdScale = hmdInterface->getIPDScale();
|
||||
|
||||
// Scale by proportional differences between avatar and human.
|
||||
float humanEyeSeparationInModelSpace = glm::length(humanLeftEye - humanRightEye);
|
||||
float humanEyeSeparationInModelSpace = glm::length(humanLeftEye - humanRightEye) * ipdScale;
|
||||
float avatarEyeSeparation = glm::length(avatarLeftEye - avatarRightEye);
|
||||
gazeOffset = gazeOffset * humanEyeSeparationInModelSpace / avatarEyeSeparation;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue