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

Unified Diff: ui/gfx/vector3d_f.h

Issue 11293193: ui: Add non-member Vector2dScale() and Vector3dScale() methods to create scaled vectors (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: review Created 8 years, 1 month 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 | « ui/gfx/vector2d_unittest.cc ('k') | ui/gfx/vector3d_f.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/gfx/vector3d_f.h
diff --git a/ui/gfx/vector3d_f.h b/ui/gfx/vector3d_f.h
index a2845f89267880e28b4634df450471e30c520402..ccd84ec53b01c5a283df0a99907581b40b83b108 100644
--- a/ui/gfx/vector3d_f.h
+++ b/ui/gfx/vector3d_f.h
@@ -95,6 +95,17 @@ inline Vector3dF CrossProduct(const Vector3dF& lhs, const Vector3dF& rhs) {
// Return the dot product of two vectors.
UI_EXPORT float DotProduct(const Vector3dF& lhs, const Vector3dF& rhs);
+// Return a vector that is |v| scaled by the given scale factors along each
+// axis.
+UI_EXPORT Vector3dF ScaleVector3d(const Vector3dF& v,
+ float x_scale,
+ float y_scale,
+ float z_scale);
+
+// Return a vector that is |v| scaled by the given scale factor.
+inline Vector3dF ScaleVector3d(const Vector3dF& v, float scale) {
+ return ScaleVector3d(v, scale, scale, scale);
+}
} // namespace gfx
« no previous file with comments | « ui/gfx/vector2d_unittest.cc ('k') | ui/gfx/vector3d_f.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698