mirror of
https://github.com/overte-org/overte.git
synced 2025-04-24 03:33:35 +02:00
Force a minimum convergence distance on the eyes. Closes #2100.
This commit is contained in:
parent
5d99b06a48
commit
8554c1dfbf
1 changed files with 4 additions and 1 deletions
|
@ -2056,7 +2056,10 @@ void Application::updateMyAvatarLookAtPosition() {
|
|||
} else if (_isHoverVoxel) {
|
||||
distance = glm::distance(_mouseRayOrigin, getMouseVoxelWorldCoordinates(_hoverVoxel));
|
||||
}
|
||||
lookAtSpot = _mouseRayOrigin + _mouseRayDirection * distance;
|
||||
const float FIXED_MIN_EYE_DISTANCE = 0.3f;
|
||||
float minEyeDistance = FIXED_MIN_EYE_DISTANCE + (_myCamera.getMode() == CAMERA_MODE_FIRST_PERSON ? 0.0f :
|
||||
glm::distance(_mouseRayOrigin, _myAvatar->getHead()->calculateAverageEyePosition()));
|
||||
lookAtSpot = _mouseRayOrigin + _mouseRayDirection * qMax(minEyeDistance, distance);
|
||||
}
|
||||
bool trackerActive = false;
|
||||
float eyePitch, eyeYaw;
|
||||
|
|
Loading…
Reference in a new issue