| OLD | NEW |
| 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 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 6 #define CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <memory> | 8 #include <memory> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 GestureDetectorState state_; | 122 GestureDetectorState state_; |
| 123 | 123 |
| 124 std::unique_ptr<gvr::ControllerApi> controller_api_; | 124 std::unique_ptr<gvr::ControllerApi> controller_api_; |
| 125 | 125 |
| 126 // The last controller state (updated once per frame). | 126 // The last controller state (updated once per frame). |
| 127 std::unique_ptr<gvr::ControllerState> controller_state_; | 127 std::unique_ptr<gvr::ControllerState> controller_state_; |
| 128 | 128 |
| 129 float last_qx_; | 129 float last_qx_; |
| 130 bool pinch_started_; | 130 bool pinch_started_; |
| 131 bool zoom_in_progress_ = false; | 131 bool zoom_in_progress_ = false; |
| 132 bool touch_position_changed_ = false; |
| 132 | 133 |
| 134 // Current touch info after the extrapolation. |
| 133 std::unique_ptr<TouchInfo> touch_info_; | 135 std::unique_ptr<TouchInfo> touch_info_; |
| 134 | 136 |
| 135 // A pointer storing the touch point from previous frame. | 137 // A pointer storing the touch point from previous frame. |
| 136 std::unique_ptr<TouchPoint> prev_touch_point_; | 138 std::unique_ptr<TouchPoint> prev_touch_point_; |
| 137 | 139 |
| 138 // A pointer storing the touch point from current frame. | 140 // A pointer storing the touch point from current frame. |
| 139 std::unique_ptr<TouchPoint> cur_touch_point_; | 141 std::unique_ptr<TouchPoint> cur_touch_point_; |
| 140 | 142 |
| 141 // Initial touch point. | 143 // Initial touch point. |
| 142 std::unique_ptr<TouchPoint> init_touch_point_; | 144 std::unique_ptr<TouchPoint> init_touch_point_; |
| 143 | 145 |
| 144 // Overall velocity | 146 // Overall velocity |
| 145 gvr::Vec2f overall_velocity_; | 147 gvr::Vec2f overall_velocity_; |
| 146 | 148 |
| 149 // Last velocity that is used for fling and direction detection |
| 150 gvr::Vec2f last_velocity_; |
| 151 |
| 147 // Displacement of the touch point from the previews to the current touch | 152 // Displacement of the touch point from the previews to the current touch |
| 148 gvr::Vec2f displacement_; | 153 gvr::Vec2f displacement_; |
| 149 | 154 |
| 150 int64_t last_touch_timestamp_ = 0; | 155 int64_t last_touch_timestamp_ = 0; |
| 151 int64_t last_timestamp_nanos_ = 0; | 156 int64_t last_timestamp_nanos_ = 0; |
| 152 | 157 |
| 158 // Number of consecutively extrapolated touch points |
| 159 int extrapolated_touch_ = 0; |
| 160 |
| 153 DISALLOW_COPY_AND_ASSIGN(VrController); | 161 DISALLOW_COPY_AND_ASSIGN(VrController); |
| 154 }; | 162 }; |
| 155 | 163 |
| 156 } // namespace vr_shell | 164 } // namespace vr_shell |
| 157 | 165 |
| 158 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ | 166 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ |
| OLD | NEW |