Commit 7ffe8277 authored by Max Rebuschatis's avatar Max Rebuschatis Committed by Commit Bot

Fix for y flip on hit-test ray input

Bug: 848959
Change-Id: I99c958ba7ae1de5c233e77d085dbd20880baf6ca
Reviewed-on: https://chromium-review.googlesource.com/1089812
Commit-Queue: Max Rebuschatis <lincolnfrog@chromium.org>
Reviewed-by: default avatarKlaus Weidner <klausw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#565695}
parent 4a9479ae
...@@ -318,7 +318,11 @@ bool ARCoreImpl::TransformRayToScreenSpace(const mojom::XRRayPtr& ray, ...@@ -318,7 +318,11 @@ bool ARCoreImpl::TransformRayToScreenSpace(const mojom::XRRayPtr& ray,
} }
screen_point->set_x((screen_point_3d.x() + 1) / 2); screen_point->set_x((screen_point_3d.x() + 1) / 2);
screen_point->set_y((screen_point_3d.y() + 1) / 2); // The calculated point in GL's normalized device coordinates (NDC) ranges
// from -1..1, with -1, -1 at the bottom left of the screen, +1 at the top.
// The output screen space coordinates range from 0..1, with 0, 0 at the
// top left.
screen_point->set_y((-screen_point_3d.y() + 1) / 2);
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment