Chromium Code Reviews| OLD | NEW |
|---|---|
| (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.h" | |
|
cjgrant
2017/03/21 15:55:38
Is it only gvr_types.h needed here?
klausw
2017/03/21 16:55:56
Indeed, done.
| |
| 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 GvrGamepaDataFetcher. | |
| 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. | |
| 31 // Also lazily creates and registers the gamepad data factory | |
| 32 // with the gamepad manager as needed. | |
| 33 virtual void GamepadDataUpdate(GvrGamepadData data) = 0; | |
| 34 | |
| 35 // Called by the gamepad data fetcher to retrieve the latest snapshot | |
| 36 // of controller data. | |
| 37 virtual GvrGamepadData GamepadDataGet() = 0; | |
| 38 }; | |
| 39 | |
| 40 } // namespace device | |
| 41 #endif // DEVICE_VR_ANDROID_GVR_GAMEPAD_DATA_PROVIDER_H | |
| OLD | NEW |