diff options
Diffstat (limited to 'ui')
-rw-r--r-- | ui/gfx/geometry/point3_f.h | 4 | ||||
-rw-r--r-- | ui/gfx/geometry/vector3d_f.h | 5 |
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); |