mirror of
https://github.com/overte-org/overte.git
synced 2025-08-06 18:50:00 +02:00
Render lookatIndicator for cursor select even when gyros are on for
more consistent behavior.
This commit is contained in:
parent
bbcf5b4d8d
commit
c579f70611
1 changed files with 14 additions and 10 deletions
|
@ -2612,17 +2612,20 @@ void Application::updateAvatar(float deltaTime) {
|
||||||
_headMouseY = min(_headMouseY, _glWidget->height());
|
_headMouseY = min(_headMouseY, _glWidget->height());
|
||||||
|
|
||||||
const float MIDPOINT_OF_SCREEN = 0.5;
|
const float MIDPOINT_OF_SCREEN = 0.5;
|
||||||
|
|
||||||
// Set lookAtPosition if an avatar is at the center of the screen
|
|
||||||
glm::vec3 screenCenterRayOrigin, screenCenterRayDirection;
|
|
||||||
_viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection);
|
|
||||||
|
|
||||||
glm::vec3 eyePosition;
|
|
||||||
|
|
||||||
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition);
|
// Only use gyro to set lookAt if mouse hasn't selected an avatar
|
||||||
if (_isLookingAtOtherAvatar) {
|
if (!_isLookingAtOtherAvatar) {
|
||||||
glm::vec3 myLookAtFromMouse(eyePosition);
|
|
||||||
_myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
|
// Set lookAtPosition if an avatar is at the center of the screen
|
||||||
|
glm::vec3 screenCenterRayOrigin, screenCenterRayDirection;
|
||||||
|
_viewFrustum.computePickRay(MIDPOINT_OF_SCREEN, MIDPOINT_OF_SCREEN, screenCenterRayOrigin, screenCenterRayDirection);
|
||||||
|
|
||||||
|
glm::vec3 eyePosition;
|
||||||
|
_isLookingAtOtherAvatar = isLookingAtOtherAvatar(screenCenterRayOrigin, screenCenterRayDirection, eyePosition);
|
||||||
|
if (_isLookingAtOtherAvatar) {
|
||||||
|
glm::vec3 myLookAtFromMouse(eyePosition);
|
||||||
|
_myAvatar.getHead().setLookAtPosition(myLookAtFromMouse);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -3027,6 +3030,7 @@ void Application::displaySide(Camera& whichCamera) {
|
||||||
if (!avatar->isInitialized()) {
|
if (!avatar->isInitialized()) {
|
||||||
avatar->init();
|
avatar->init();
|
||||||
}
|
}
|
||||||
|
// Set lookAt to myCamera on client side if other avatars are looking at client
|
||||||
if (isLookingAtMyAvatar(avatar)) {
|
if (isLookingAtMyAvatar(avatar)) {
|
||||||
avatar->getHead().setLookAtPosition(_myCamera.getPosition());
|
avatar->getHead().setLookAtPosition(_myCamera.getPosition());
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue