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

Side by Side Diff: ui/gfx/geometry/vector3d_f.h

Issue 759063002: Move Screen Rotation from MaximizeModeController to ScreenOrientationController (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix Linux Compile Created 5 years, 11 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 unified diff | Download patch
« no previous file with comments | « chromeos/accelerometer/accelerometer_reader.cc ('k') | ui/gfx/geometry/vector3d_f.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 // Defines a simple float vector class. This class is used to indicate a 5 // Defines a simple float vector class. This class is used to indicate a
6 // distance in two dimensions between two points. Subtracting two points should 6 // distance in two dimensions between two points. Subtracting two points should
7 // produce a vector, and adding a vector to a point produces the point at the 7 // produce a vector, and adding a vector to a point produces the point at the
8 // vector's distance from the original point. 8 // vector's distance from the original point.
9 9
10 #ifndef UI_GFX_GEOMETRY_VECTOR3D_F_H_ 10 #ifndef UI_GFX_GEOMETRY_VECTOR3D_F_H_
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 GFX_EXPORT Vector3dF ScaleVector3d(const Vector3dF& v, 113 GFX_EXPORT Vector3dF ScaleVector3d(const Vector3dF& v,
114 float x_scale, 114 float x_scale,
115 float y_scale, 115 float y_scale,
116 float z_scale); 116 float z_scale);
117 117
118 // Return a vector that is |v| scaled by the given scale factor. 118 // Return a vector that is |v| scaled by the given scale factor.
119 inline Vector3dF ScaleVector3d(const Vector3dF& v, float scale) { 119 inline Vector3dF ScaleVector3d(const Vector3dF& v, float scale) {
120 return ScaleVector3d(v, scale, scale, scale); 120 return ScaleVector3d(v, scale, scale, scale);
121 } 121 }
122 122
123 // Returns the angle between |base| and |other| in degrees.
124 GFX_EXPORT float AngleBetweenVectorsInDegrees(const gfx::Vector3dF& base,
125 const gfx::Vector3dF& other);
126
127 // Returns the clockwise angle between |base| and |other| where |normal| is the
128 // normal of the virtual surface to measure clockwise according to.
129 GFX_EXPORT float ClockwiseAngleBetweenVectorsInDegrees(
130 const gfx::Vector3dF& base,
131 const gfx::Vector3dF& other,
132 const gfx::Vector3dF& normal);
133
123 // This is declared here for use in gtest-based unit tests but is defined in 134 // This is declared here for use in gtest-based unit tests but is defined in
124 // the gfx_test_support target. Depend on that to use this in your unit test. 135 // the gfx_test_support target. Depend on that to use this in your unit test.
125 // This should not be used in production code - call ToString() instead. 136 // This should not be used in production code - call ToString() instead.
126 void PrintTo(const Vector3dF& vector, ::std::ostream* os); 137 void PrintTo(const Vector3dF& vector, ::std::ostream* os);
127 138
128 } // namespace gfx 139 } // namespace gfx
129 140
130 #endif // UI_GFX_GEOMETRY_VECTOR3D_F_H_ 141 #endif // UI_GFX_GEOMETRY_VECTOR3D_F_H_
OLDNEW
« no previous file with comments | « chromeos/accelerometer/accelerometer_reader.cc ('k') | ui/gfx/geometry/vector3d_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698