mirror of
https://github.com/HifiExperiments/overte.git
synced 2025-08-04 03:33:09 +02:00
When the mouse is hidden, just look straight forward.
This commit is contained in:
parent
c93e70e3cb
commit
0e7692dfea
1 changed files with 8 additions and 2 deletions
|
@ -2080,17 +2080,23 @@ void Application::updateMyAvatarLookAtPosition(glm::vec3& lookAtSpot, glm::vec3&
|
||||||
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
|
bool showWarnings = Menu::getInstance()->isOptionChecked(MenuOption::PipelineWarnings);
|
||||||
PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
|
PerformanceWarning warn(showWarnings, "Application::updateMyAvatarLookAtPosition()");
|
||||||
|
|
||||||
|
const float FAR_AWAY_STARE = TREE_SCALE;
|
||||||
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
if (_myCamera.getMode() == CAMERA_MODE_MIRROR) {
|
||||||
lookAtSpot = _myCamera.getPosition();
|
lookAtSpot = _myCamera.getPosition();
|
||||||
|
|
||||||
|
} else if (_mouseHidden) {
|
||||||
|
// if the mouse cursor is hidden, just look straight ahead
|
||||||
|
glm::vec3 rayOrigin, rayDirection;
|
||||||
|
_viewFrustum.computePickRay(0.5f, 0.5f, rayOrigin, rayDirection);
|
||||||
|
lookAtSpot = rayOrigin + rayDirection * FAR_AWAY_STARE;
|
||||||
|
|
||||||
} else if (!_lookatTargetAvatar) {
|
} else if (!_lookatTargetAvatar) {
|
||||||
if (_isHoverVoxel) {
|
if (_isHoverVoxel) {
|
||||||
// Look at the hovered voxel
|
// Look at the hovered voxel
|
||||||
lookAtSpot = getMouseVoxelWorldCoordinates(_hoverVoxel);
|
lookAtSpot = getMouseVoxelWorldCoordinates(_hoverVoxel);
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
// Just look in direction of the mouse ray
|
// Just look in direction of the mouse ray
|
||||||
const float FAR_AWAY_STARE = TREE_SCALE;
|
|
||||||
lookAtSpot = lookAtRayOrigin + lookAtRayDirection * FAR_AWAY_STARE;
|
lookAtSpot = lookAtRayOrigin + lookAtRayDirection * FAR_AWAY_STARE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue