diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-06-18 12:35:14 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-18 12:35:14 +0200 |
commit | 3fc39954ec3473cc022af615c5eb8b1ba271e008 (patch) | |
tree | 90b2c8ccc77e6775b0fe9eae0037089ae77c0c48 /core/math/transform_3d.cpp | |
parent | 3e8620c2759e6a457ea48b159bd6664d8d98b272 (diff) | |
parent | bd6ed3fb091d2d541f85e4152f0538088a3956db (diff) |
Merge pull request #49638 from aaronfranke/multiply-transforms
Allow multiplying Transforms and Basis by numbers
Diffstat (limited to 'core/math/transform_3d.cpp')
-rw-r--r-- | core/math/transform_3d.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/core/math/transform_3d.cpp b/core/math/transform_3d.cpp index a34d998dde..51766b39f4 100644 --- a/core/math/transform_3d.cpp +++ b/core/math/transform_3d.cpp @@ -190,6 +190,17 @@ Transform3D Transform3D::operator*(const Transform3D &p_transform) const { return t; } +void Transform3D::operator*=(const real_t p_val) { + origin *= p_val; + basis *= p_val; +} + +Transform3D Transform3D::operator*(const real_t p_val) const { + Transform3D ret(*this); + ret *= p_val; + return ret; +} + Transform3D::operator String() const { return "[X: " + basis.get_axis(0).operator String() + ", Y: " + basis.get_axis(1).operator String() + |