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

Side by Side Diff: chrome/browser/android/vr_shell/vr_controller.cc

Issue 2598093002: Update GVR to 1.10.0 (Closed)
Patch Set: Created 4 years 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 unified diff | Download patch
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/android/vr_shell/vr_controller.h" 5 #include "chrome/browser/android/vr_shell/vr_controller.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr.h" 11 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr.h"
12 #include "third_party/gvr-android-sdk/src/ndk/include/vr/gvr/capi/include/gvr_co ntroller.h" 12 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_controller.h"
13 13
14 namespace vr_shell { 14 namespace vr_shell {
15 15
16 namespace { 16 namespace {
17 17
18 constexpr float kDisplacementScaleFactor = 300.0f; 18 constexpr float kDisplacementScaleFactor = 300.0f;
19 19
20 // A slop represents a small rectangular region around the first touch point of 20 // A slop represents a small rectangular region around the first touch point of
21 // a gesture. 21 // a gesture.
22 // If the user does not move outside of the slop, no gesture is detected. 22 // If the user does not move outside of the slop, no gesture is detected.
(...skipping 343 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 gvr::Vec2f velocity = Vector::ScalarMult(displacement, 1 / duration); 366 gvr::Vec2f velocity = Vector::ScalarMult(displacement, 1 / duration);
367 367
368 float weight = duration / (kRC + duration); 368 float weight = duration / (kRC + duration);
369 369
370 overall_velocity_ = 370 overall_velocity_ =
371 Vector::Add(Vector::ScalarMult(overall_velocity_, 1 - weight), 371 Vector::Add(Vector::ScalarMult(overall_velocity_, 1 - weight),
372 Vector::ScalarMult(velocity, weight)); 372 Vector::ScalarMult(velocity, weight));
373 } 373 }
374 374
375 } // namespace vr_shell 375 } // namespace vr_shell
OLDNEW
« no previous file with comments | « chrome/browser/android/vr_shell/vr_controller.h ('k') | chrome/browser/android/vr_shell/vr_gl_util.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698