Chromium Code Reviews| Index: chrome/browser/android/vr_shell/elbow_model.cc |
| diff --git a/chrome/browser/android/vr_shell/elbow_model.cc b/chrome/browser/android/vr_shell/elbow_model.cc |
| index f71ece01a3eaa3a2a2ab7f61fe625a0307d112cf..74aa9ec9498aaf40d493c6b0d38b9c2be12021fb 100644 |
| --- a/chrome/browser/android/vr_shell/elbow_model.cc |
| +++ b/chrome/browser/android/vr_shell/elbow_model.cc |
| @@ -32,13 +32,16 @@ constexpr float kDefaultElbowRotationRatio = 0.4f; |
| } // namespace |
| ElbowModel::ElbowModel(gvr::ControllerHandedness handedness) |
| - : handedness_(handedness), |
| - alpha_value_(1.0f), |
| - torso_direction_{0.0f, 0.0f, 0.0f} {} |
| + : alpha_value_(1.0f), torso_direction_{0.0f, 0.0f, 0.0f} { |
| + UpdateHandedness(handedness); |
| +} |
| ElbowModel::~ElbowModel() = default; |
| -void ElbowModel::UpdateHandedness() { |
| +void ElbowModel::UpdateHandedness(gvr::ControllerHandedness handedness) { |
| + if (handedness == handedness_) |
|
acondor_
2017/05/02 14:18:34
We might need an invalid default handedness value
mthiesse
2017/05/02 15:23:37
Done.
|
| + return; |
| + handedness_ = handedness; |
| handed_multiplier_ = { |
| handedness_ == GVR_CONTROLLER_RIGHT_HANDED ? 1.0f : -1.0f, 1.0f, 1.0f}; |
| shoulder_rotation_ = kNoRotation; |
| @@ -47,7 +50,6 @@ void ElbowModel::UpdateHandedness() { |
| } |
| void ElbowModel::Update(const UpdateData& update) { |
| - UpdateHandedness(); |
| UpdateTorsoDirection(update); |
| ApplyArmModel(update); |
| UpdateTransparency(update); |