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

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

Issue 2762003002: Refactor GVR controller gamepad API integration (Closed)
Patch Set: Fix comment, include gvr_types only for data provider 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 unified diff | Download patch
« no previous file with comments | « device/vr/android/gvr/gvr_gamepad_data_fetcher.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H
6 #define DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H
7
8 #include "third_party/gvr-android-sdk/src/libraries/headers/vr/gvr/capi/include/ gvr_types.h"
9
10 namespace device {
11
12 // Subset of GVR controller data needed for the gamepad API. Filled in
13 // by vr_shell's VrController and consumed by GvrGamepadDataFetcher.
14 struct GvrGamepadData {
15 int64_t timestamp;
16 gvr_vec2f touch_pos;
17 gvr_quatf orientation;
18 gvr_vec3f accel;
19 gvr_vec3f gyro;
20 bool is_touching;
21 bool controller_button_pressed;
22 bool right_handed;
23 };
24
25 // This class exposes GVR controller data to the gamepad API. Data is
26 // polled by VrShellGl, then posted to VrShell which implements the
27 // GvrGamepadDataProvider interface.
28 class GvrGamepadDataProvider {
29 public:
30 // Refresh current GVR controller data for use by gamepad API. The
31 // implementation also lazily creates and registers the GVR
32 // GamepadDataFetcherFactory with the GamepadDataFetcherManager as
33 // needed.
34 virtual void GamepadDataUpdate(GvrGamepadData data) = 0;
mthiesse 2017/03/21 17:35:13 nit: Update/GetGamepadData? GamepadDataGet is stra
klausw 2017/03/21 18:28:55 Renamed both to put the verb first. I don't like O
35
36 // Called by the gamepad data fetcher to retrieve the latest snapshot
37 // of controller data.
38 virtual GvrGamepadData GamepadDataGet() = 0;
39 };
40
41 } // namespace device
42 #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') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698