Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(172)

Unified Diff: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc

Issue 2770353002: WebVR: add angular velocity estimate to pose (Closed)
Patch Set: Enable linear accel, fix angular velocity to be in seated space Created 3 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
diff --git a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
index c2457ba4176e627bc8351dec29fdc59ff6924d6c..8ae932a349273b6b1051c1f81b984ca60e9e92b3 100644
--- a/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
+++ b/chrome/browser/android/vr_shell/non_presenting_gvr_delegate.cc
@@ -13,7 +13,9 @@
namespace vr_shell {
namespace {
+// TODO(klausw): These are duplicates from vr_shell_gl.cc, put in header file?
billorr 2017/03/27 17:33:53 any reason not to do this now?
klausw 2017/03/27 17:55:42 Done - though it's annoying that it's now no longe
static constexpr int64_t kPredictionTimeWithoutVsyncNanos = 50000000;
+static constexpr int64_t kAngularVelocityEpsilonNanos = 1000000;
} // namespace
NonPresentingGvrDelegate::NonPresentingGvrDelegate(gvr_context* context)
@@ -153,8 +155,14 @@ void NonPresentingGvrDelegate::SendVSync(base::TimeDelta time,
gvr::Mat4f head_mat = gvr_api_->ApplyNeckModel(
gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time), 1.0f);
- callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat), time, -1,
- device::mojom::VRVSyncProvider::Status::SUCCESS);
+
+ target_time.monotonic_system_time_nanos += kAngularVelocityEpsilonNanos;
+ gvr::Mat4f head_mat_2 =
+ gvr_api_->GetHeadSpaceFromStartSpaceRotation(target_time);
+
+ callback.Run(VrShell::VRPosePtrFromGvrPose(head_mat, head_mat_2,
+ kAngularVelocityEpsilonNanos),
+ time, -1, device::mojom::VRVSyncProvider::Status::SUCCESS);
}
bool NonPresentingGvrDelegate::SupportsPresentation() {
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_controller.cc » ('j') | chrome/browser/android/vr_shell/vr_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698