Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(416)

Unified Diff: device/vr/vr_math.cc

Issue 2816833002: VR: Fix dynamic resizing webVR page, revert FOV calculation changes. (Closed)
Patch Set: Correct diffbase Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « device/vr/vr_math.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: device/vr/vr_math.cc
diff --git a/device/vr/vr_math.cc b/device/vr/vr_math.cc
index 776139635a08aea35963795576f7adfacc004fe0..cd95d5eba1cc917e802ce385c5f03908202d8143 100644
--- a/device/vr/vr_math.cc
+++ b/device/vr/vr_math.cc
@@ -99,36 +99,6 @@ void MatrixMul(const Mat4f& matrix1, const Mat4f& matrix2, Mat4f* out) {
}
}
-void PerspectiveMatrixFromView(const gfx::RectF& fov,
- float z_near,
- float z_far,
- Mat4f* out) {
- const float x_left = -std::tan(fov.x() * M_PI / 180.0f) * z_near;
- const float x_right = std::tan(fov.right() * M_PI / 180.0f) * z_near;
- const float y_bottom = -std::tan(fov.bottom() * M_PI / 180.0f) * z_near;
- const float y_top = std::tan(fov.y() * M_PI / 180.0f) * z_near;
-
- DCHECK(x_left < x_right && y_bottom < y_top && z_near < z_far &&
- z_near > 0.0f && z_far > 0.0f);
- const float X = (2 * z_near) / (x_right - x_left);
- const float Y = (2 * z_near) / (y_top - y_bottom);
- const float A = (x_right + x_left) / (x_right - x_left);
- const float B = (y_top + y_bottom) / (y_top - y_bottom);
- const float C = (z_near + z_far) / (z_near - z_far);
- const float D = (2 * z_near * z_far) / (z_near - z_far);
-
- for (int i = 0; i < 4; ++i) {
- (*out)[i].fill(0.0f);
- }
- (*out)[0][0] = X;
- (*out)[0][2] = A;
- (*out)[1][1] = Y;
- (*out)[1][2] = B;
- (*out)[2][2] = C;
- (*out)[2][3] = D;
- (*out)[3][2] = -1;
-}
-
gfx::Vector3dF GetForwardVector(const Mat4f& matrix) {
// Same as multiplying the inverse of the rotation component of the matrix by
// (0, 0, -1, 0).
« no previous file with comments | « device/vr/vr_math.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698