| OLD | NEW |
| 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 Loading... |
| 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 SetHandedness(gvr::ControllerHandedness handedness); |
| 34 | 35 |
| 35 private: | 36 private: |
| 36 void UpdateHandedness(); | 37 void UpdateHandedness(); |
| 37 void UpdateTorsoDirection(const UpdateData& update); | 38 void UpdateTorsoDirection(const UpdateData& update); |
| 38 void ApplyArmModel(const UpdateData& update); | 39 void ApplyArmModel(const UpdateData& update); |
| 39 void UpdateTransparency(const UpdateData& update); | 40 void UpdateTransparency(const UpdateData& update); |
| 40 | 41 |
| 41 gvr::ControllerHandedness handedness_; | 42 gvr::ControllerHandedness handedness_; |
| 42 | 43 |
| 43 gfx::Point3F wrist_position_; | 44 gfx::Point3F wrist_position_; |
| 44 vr::Quatf wrist_rotation_; | 45 vr::Quatf wrist_rotation_; |
| 45 float alpha_value_; | 46 float alpha_value_; |
| 46 | 47 |
| 47 gfx::Point3F elbow_position_; | 48 gfx::Point3F elbow_position_; |
| 48 vr::Quatf elbow_rotation_; | 49 vr::Quatf elbow_rotation_; |
| 49 gfx::Point3F shoulder_position_; | 50 gfx::Point3F shoulder_position_; |
| 50 vr::Quatf shoulder_rotation_; | 51 vr::Quatf shoulder_rotation_; |
| 51 gfx::Vector3dF torso_direction_; | 52 gfx::Vector3dF torso_direction_; |
| 52 gfx::Vector3dF handed_multiplier_; | 53 gfx::Vector3dF handed_multiplier_; |
| 53 }; | 54 }; |
| 54 | 55 |
| 55 } // namespace vr_shell | 56 } // namespace vr_shell |
| 56 | 57 |
| 57 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_ | 58 #endif // CHROME_BROWSER_ANDROID_VR_SHELL_ELBOW_MODEL_H_ |
| OLD | NEW |