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

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

Issue 2591253002: VR: Improve scrolling (Closed)
Patch Set: VR: Improve scrolling Created 3 years, 11 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
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 #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
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
137 // Current touch position reported by touchpad.
138 std::unique_ptr<TouchPoint> touch_point_;
bshe 2017/01/09 19:38:54 Is it possible to use cur_touch_point_ directly to
asimjour1 2017/01/11 21:59:45 It is possible. But more changes would be needed.
139
135 // A pointer storing the touch point from previous frame. 140 // A pointer storing the touch point from previous frame.
136 std::unique_ptr<TouchPoint> prev_touch_point_; 141 std::unique_ptr<TouchPoint> prev_touch_point_;
137 142
138 // A pointer storing the touch point from current frame. 143 // A pointer storing the touch point from current frame.
139 std::unique_ptr<TouchPoint> cur_touch_point_; 144 std::unique_ptr<TouchPoint> cur_touch_point_;
140 145
141 // Initial touch point. 146 // Initial touch point.
142 std::unique_ptr<TouchPoint> init_touch_point_; 147 std::unique_ptr<TouchPoint> init_touch_point_;
143 148
144 // Overall velocity 149 // Overall velocity
145 gvr::Vec2f overall_velocity_; 150 gvr::Vec2f overall_velocity_;
146 151
152 // Last velocity that is used for fling and direction detection
153 gvr::Vec2f last_velocity_;
154
147 // Displacement of the touch point from the previews to the current touch 155 // Displacement of the touch point from the previews to the current touch
148 gvr::Vec2f displacement_; 156 gvr::Vec2f displacement_;
149 157
150 int64_t last_touch_timestamp_ = 0; 158 int64_t last_touch_timestamp_ = 0;
151 int64_t last_timestamp_nanos_ = 0; 159 int64_t last_timestamp_nanos_ = 0;
152 160
161 // Number of consecutively extrapolated touch points
162 int extrapolated_touch_ = 0;
163
153 DISALLOW_COPY_AND_ASSIGN(VrController); 164 DISALLOW_COPY_AND_ASSIGN(VrController);
154 }; 165 };
155 166
156 } // namespace vr_shell 167 } // namespace vr_shell
157 168
158 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_ 169 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_VR_CONTROLLER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/vr_controller.cc » ('j') | chrome/browser/android/vr_shell/vr_controller.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698