| 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 f2cd825af75f56f90515bedbbf356bf0e49d46ee..723c3454f71682e49f8dca8bee04d08acd08a526 100644
|
| --- a/chrome/browser/android/vr_shell/elbow_model.cc
|
| +++ b/chrome/browser/android/vr_shell/elbow_model.cc
|
| @@ -32,10 +32,19 @@ constexpr float kDefaultElbowRotationRatio = 0.4f;
|
| } // namespace
|
|
|
| ElbowModel::ElbowModel(gvr::ControllerHandedness handedness)
|
| - : handedness_(handedness), alpha_value_(1.0f), torso_direction_(kForward) {}
|
| + : handedness_(handedness), alpha_value_(1.0f), torso_direction_(kForward) {
|
| + UpdateHandedness();
|
| +}
|
|
|
| ElbowModel::~ElbowModel() = default;
|
|
|
| +void ElbowModel::SetHandedness(gvr::ControllerHandedness handedness) {
|
| + if (handedness == handedness_)
|
| + return;
|
| + handedness_ = handedness;
|
| + UpdateHandedness();
|
| +}
|
| +
|
| void ElbowModel::UpdateHandedness() {
|
| handed_multiplier_ = {
|
| handedness_ == GVR_CONTROLLER_RIGHT_HANDED ? 1.0f : -1.0f, 1.0f, 1.0f};
|
| @@ -45,7 +54,6 @@ void ElbowModel::UpdateHandedness() {
|
| }
|
|
|
| void ElbowModel::Update(const UpdateData& update) {
|
| - UpdateHandedness();
|
| UpdateTorsoDirection(update);
|
| ApplyArmModel(update);
|
| UpdateTransparency(update);
|
|
|