summaryrefslogtreecommitdiff
path: root/ui
diff options
context:
space:
mode:
authorIan Vollick <vollick@chromium.org>2017-06-15 00:27:08 +0900
committerQijiang Fan <fqj@google.com>2020-06-05 06:23:52 +0900
commit56dc30c186f4c35f93ab3d03f2b2095c0aa4083a (patch)
treeea91a14a3d025d3c06e4c195047356ad9c2062cc /ui
parentfb0bdf0ef12b00a743e850c77aed1d87cf437c7c (diff)
downloadlibchrome-56dc30c186f4c35f93ab3d03f2b2095c0aa4083a.tar.gz
Convert ElbowModel to gfx types
This is one step in the migration away from vr types. I've also introduced some vr <-> gfx conversion routines in vr_math to ease the transition. Bug: 718004 Change-Id: I1bc686f2a9794c46ff4422b4bcea78861678dc39 Reviewed-on: https://chromium-review.googlesource.com/535793 Commit-Queue: Ian Vollick <vollick@chromium.org> Reviewed-by: Michael Thiessen <mthiesse@chromium.org> Cr-Commit-Position: refs/heads/master@{#479426} CrOS-Libchrome-Original-Commit: a25066c9a379ed1ed98830c504986ea2e2363b1b
Diffstat (limited to 'ui')
-rw-r--r--ui/gfx/geometry/point3_f.h4
-rw-r--r--ui/gfx/geometry/vector3d_f.h5
2 files changed, 9 insertions, 0 deletions
diff --git a/ui/gfx/geometry/point3_f.h b/ui/gfx/geometry/point3_f.h
index 71f428f225..15a560c497 100644
--- a/ui/gfx/geometry/point3_f.h
+++ b/ui/gfx/geometry/point3_f.h
@@ -110,6 +110,10 @@ inline Point3F ScalePoint(const Point3F& p,
return Point3F(p.x() * x_scale, p.y() * y_scale, p.z() * z_scale);
}
+inline Point3F ScalePoint(const Point3F& p, const Vector3dF& v) {
+ return Point3F(p.x() * v.x(), p.y() * v.y(), p.z() * v.z());
+}
+
inline Point3F ScalePoint(const Point3F& p, float scale) {
return ScalePoint(p, scale, scale, scale);
}
diff --git a/ui/gfx/geometry/vector3d_f.h b/ui/gfx/geometry/vector3d_f.h
index 0bb42b4758..0e5e43713a 100644
--- a/ui/gfx/geometry/vector3d_f.h
+++ b/ui/gfx/geometry/vector3d_f.h
@@ -120,6 +120,11 @@ GFX_EXPORT Vector3dF ScaleVector3d(const Vector3dF& v,
float y_scale,
float z_scale);
+// Return a vector that is |v| scaled by the components of |s|
+inline Vector3dF ScaleVector3d(const Vector3dF& v, const Vector3dF& s) {
+ return ScaleVector3d(v, s.x(), s.y(), s.z());
+}
+
// 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);