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

Side by Side Diff: device/vr/android/gvr/gvr_gamepad_data_provider.h

Issue 2814443004: Refactor VR math off of GVR types, onto gfx types where possible. (Closed)
Patch Set: Fix tests Created 3 years, 8 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 unified diff | Download patch
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.cc ('k') | device/vr/vr_export.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2017 The Chromium Authors. All rights reserved. 1 // Copyright 2017 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 #ifndef DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H 5 #ifndef DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H
6 #define DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H 6 #define DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H
7 7
8 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h" 8 #include "device/vr/vr_types.h"
9 9
10 namespace device { 10 namespace device {
11 11
12 class GvrGamepadDataFetcher; 12 class GvrGamepadDataFetcher;
13 13
14 // Subset of GVR controller data needed for the gamepad API. Filled in 14 // Subset of GVR controller data needed for the gamepad API. Filled in
15 // by vr_shell's VrController and consumed by GvrGamepadDataFetcher. 15 // by vr_shell's VrController and consumed by GvrGamepadDataFetcher.
16 struct GvrGamepadData { 16 struct GvrGamepadData {
17 int64_t timestamp; 17 int64_t timestamp;
18 gvr_vec2f touch_pos; 18 gfx::Vector2dF touch_pos;
19 gvr_quatf orientation; 19 vr::Quatf orientation;
20 gvr_vec3f accel; 20 gfx::Vector3dF accel;
21 gvr_vec3f gyro; 21 gfx::Vector3dF gyro;
22 bool is_touching; 22 bool is_touching;
23 bool controller_button_pressed; 23 bool controller_button_pressed;
24 bool right_handed; 24 bool right_handed;
25 }; 25 };
26 26
27 // This class exposes GVR controller data to the gamepad API. Data is 27 // This class exposes GVR controller data to the gamepad API. Data is
28 // polled by VrShellGl, then pushed from VrShell which implements the 28 // polled by VrShellGl, then pushed from VrShell which implements the
29 // GvrGamepadDataProvider interface. 29 // GvrGamepadDataProvider interface.
30 // 30 //
31 // More specifically, here's the lifecycle, assuming VrShell 31 // More specifically, here's the lifecycle, assuming VrShell
(...skipping 26 matching lines...) Expand all
58 virtual void UpdateGamepadData(GvrGamepadData data) = 0; 58 virtual void UpdateGamepadData(GvrGamepadData data) = 0;
59 59
60 // Called by the gamepad data fetcher constructor to register itself 60 // Called by the gamepad data fetcher constructor to register itself
61 // for receiving data via SetGamepadData. The fetcher must remain 61 // for receiving data via SetGamepadData. The fetcher must remain
62 // alive while the provider is calling SetGamepadData on it. 62 // alive while the provider is calling SetGamepadData on it.
63 virtual void RegisterGamepadDataFetcher(GvrGamepadDataFetcher*) = 0; 63 virtual void RegisterGamepadDataFetcher(GvrGamepadDataFetcher*) = 0;
64 }; 64 };
65 65
66 } // namespace device 66 } // namespace device
67 #endif // DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H 67 #endif // DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H
OLDNEW
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.cc ('k') | device/vr/vr_export.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698