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

Unified Diff: content/browser/vr/vr_transform_util.cc

Issue 1274913004: Revert of Android WebVR implementation, Cardboard 0.5.5 SDK (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 | « content/browser/vr/vr_transform_util.h ('k') | content/browser/vr/vr_transform_util_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/vr/vr_transform_util.cc
diff --git a/content/browser/vr/vr_transform_util.cc b/content/browser/vr/vr_transform_util.cc
deleted file mode 100644
index f46955297228ea8f8817abe9e9083efec21be492..0000000000000000000000000000000000000000
--- a/content/browser/vr/vr_transform_util.cc
+++ /dev/null
@@ -1,46 +0,0 @@
-// Copyright 2015 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "content/browser/vr/vr_transform_util.h"
-
-#include <math.h>
-
-namespace content {
-
-// Source:
-// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToQuaternion/
-VRVector4Ptr MatrixToOrientationQuaternion(
- const float m0[3], const float m1[3], const float m2[3]) {
- VRVector4Ptr out = VRVector4::New();
- float trace = m0[0] + m1[1] + m2[2];
- float root;
- if (trace > 0.0f) {
- root = sqrtf(1.0f + trace) * 2.0f;
- out->x = (m2[1] - m1[2]) / root;
- out->y = (m0[2] - m2[0]) / root;
- out->z = (m1[0] - m0[1]) / root;
- out->w = 0.25f * root;
- } else if ((m0[0] > m1[1]) && (m0[0] > m2[2])) {
- root = sqrtf(1.0f + m0[0] - m1[1] - m2[2]) * 2.0f;
- out->x = 0.25f * root;
- out->y = (m0[1] + m1[0]) / root;
- out->z = (m0[2] + m2[0]) / root;
- out->w = (m2[1] - m1[2]) / root;
- } else if (m1[1] > m2[2]) {
- root = sqrtf(1.0f + m1[1] - m0[0] - m2[2]) * 2.0f;
- out->x = (m0[1] + m1[0]) / root;
- out->y = 0.25f * root;
- out->z = (m1[2] + m2[1]) / root;
- out->w = (m0[2] - m2[0]) / root;
- } else {
- root = sqrtf(1.0f + m2[2] - m0[0] - m1[1]) * 2.0f;
- out->x = (m0[2] + m2[0]) / root;
- out->y = (m1[2] + m2[1]) / root;
- out->z = 0.25f * root;
- out->w = (m1[0] - m0[1]) / root;
- }
- return out.Pass();
-}
-
-} // namespace content
« no previous file with comments | « content/browser/vr/vr_transform_util.h ('k') | content/browser/vr/vr_transform_util_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698