Commit f00f17c2 authored by acondor's avatar acondor Committed by Commit bot

Fix controller positioning in VrShell when gyro reads are small

BUG=716201

Review-Url: https://codereview.chromium.org/2853843002
Cr-Commit-Position: refs/heads/master@{#468375}
parent b9c3c20b
......@@ -32,9 +32,7 @@ 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} {}
: handedness_(handedness), alpha_value_(1.0f), torso_direction_(kForward) {}
ElbowModel::~ElbowModel() = default;
......
......@@ -120,6 +120,9 @@ float NormalizeVector(gfx::Vector3dF* vec) {
void NormalizeQuat(Quatf* quat) {
float len = sqrt(quat->qx * quat->qx + quat->qy * quat->qy +
quat->qz * quat->qz + quat->qw * quat->qw);
DCHECK_NE(len, 0);
if (len == 0)
return;
quat->qx /= len;
quat->qy /= len;
quat->qz /= len;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment