mirror of
https://github.com/overte-org/overte.git
synced 2025-04-22 17:53:32 +02:00
Fix computePickRay when in mirror mode
In mirror mode the view frustum is unaffected - instead we flip the final image. To compensate for this, we need to flip the x coordinate of our pick point when picking in mirror mode.
This commit is contained in:
parent
566c837bba
commit
1f259d235d
1 changed files with 3 additions and 0 deletions
|
@ -6190,6 +6190,9 @@ PickRay Application::computePickRay(float x, float y) const {
|
|||
getApplicationCompositor().computeHmdPickRay(pickPoint, result.origin, result.direction);
|
||||
} else {
|
||||
pickPoint /= getCanvasSize();
|
||||
if (_myCamera.getMode() == CameraMode::CAMERA_MODE_MIRROR) {
|
||||
pickPoint.x = 1.0f - pickPoint.x;
|
||||
}
|
||||
QMutexLocker viewLocker(&_viewMutex);
|
||||
_viewFrustum.computePickRay(pickPoint.x, pickPoint.y, result.origin, result.direction);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue