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

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

Issue 2848283003: VR: Refresh controller handedness when resuming the controller. (Closed)
Patch Set: Created 3 years, 7 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 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 // Adapted from: 5 // Adapted from:
6 // https://github.com/googlevr/gvr-unity-sdk/blob/master/Samples/DaydreamLabsCon trollerPlayground/Assets/GoogleVR/Scripts/Controller/GvrArmModel.cs 6 // https://github.com/googlevr/gvr-unity-sdk/blob/master/Samples/DaydreamLabsCon trollerPlayground/Assets/GoogleVR/Scripts/Controller/GvrArmModel.cs
7 7
8 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_ 8 #ifndef CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_
9 #define CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_ 9 #define CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_
10 10
(...skipping 13 matching lines...) Expand all
24 }; 24 };
25 25
26 explicit ElbowModel(gvr::ControllerHandedness handedness); 26 explicit ElbowModel(gvr::ControllerHandedness handedness);
27 ~ElbowModel(); 27 ~ElbowModel();
28 28
29 const gfx::Point3F& GetControllerPosition() const { return wrist_position_; } 29 const gfx::Point3F& GetControllerPosition() const { return wrist_position_; }
30 const vr::Quatf& GetControllerRotation() const { return wrist_rotation_; } 30 const vr::Quatf& GetControllerRotation() const { return wrist_rotation_; }
31 float GetAlphaValue() const { return alpha_value_; } 31 float GetAlphaValue() const { return alpha_value_; }
32 32
33 void Update(const UpdateData& update); 33 void Update(const UpdateData& update);
34 void UpdateHandedness(gvr::ControllerHandedness handedness);
34 35
35 private: 36 private:
36 void UpdateHandedness();
37 void UpdateTorsoDirection(const UpdateData& update); 37 void UpdateTorsoDirection(const UpdateData& update);
38 void ApplyArmModel(const UpdateData& update); 38 void ApplyArmModel(const UpdateData& update);
39 void UpdateTransparency(const UpdateData& update); 39 void UpdateTransparency(const UpdateData& update);
40 40
41 gvr::ControllerHandedness handedness_; 41 gvr::ControllerHandedness handedness_;
42 42
43 gfx::Point3F wrist_position_; 43 gfx::Point3F wrist_position_;
44 vr::Quatf wrist_rotation_; 44 vr::Quatf wrist_rotation_;
45 float alpha_value_; 45 float alpha_value_;
46 46
47 gfx::Point3F elbow_position_; 47 gfx::Point3F elbow_position_;
48 vr::Quatf elbow_rotation_; 48 vr::Quatf elbow_rotation_;
49 gfx::Point3F shoulder_position_; 49 gfx::Point3F shoulder_position_;
50 vr::Quatf shoulder_rotation_; 50 vr::Quatf shoulder_rotation_;
51 gfx::Vector3dF torso_direction_; 51 gfx::Vector3dF torso_direction_;
52 gfx::Vector3dF handed_multiplier_; 52 gfx::Vector3dF handed_multiplier_;
53 }; 53 };
54 54
55 } // namespace vr_shell 55 } // namespace vr_shell
56 56
57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_ 57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/vr_shell/elbow_model.cc » ('j') | chrome/browser/android/vr_shell/elbow_model.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698