Commit 455a2945 authored by klausw's avatar klausw Committed by Commit Bot

WebVR: fix angular velocity calculation for headset

The refactor https://chromium-review.googlesource.com/536475 lost a pair of
parentheses, so the division by epsilon_seconds was just dividing one of the
matrix elements instead of the difference. This broke angular velocity
calculation.

BUG=735155

Review-Url: https://codereview.chromium.org/2947843003
Cr-Commit-Position: refs/heads/master@{#480946}
parent 1237ccfd
......@@ -66,9 +66,10 @@ gfx::Vector3dF GetAngularVelocityFromPoses(gfx::Transform head_mat,
// provided by the caller.
for (int j = 0; j < 3; ++j) {
for (int i = 0; i < 3; ++i) {
delta_mat.matrix().set(j, i,
head_mat_2.matrix().get(j, i) -
head_mat.matrix().get(j, i) / epsilon_seconds);
delta_mat.matrix().set(
j, i,
(head_mat_2.matrix().get(j, i) - head_mat.matrix().get(j, i)) /
epsilon_seconds);
inverse_head_mat.matrix().set(j, i, head_mat.matrix().get(i, j));
}
delta_mat.matrix().set(j, 3, 0);
......
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