diff options
author | RĂ©mi Verschelde <rverschelde@gmail.com> | 2018-11-28 18:57:53 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-11-28 18:57:53 +0100 |
commit | 43f28452e1cd03bb40f8a9a27fc2239c3b5c2604 (patch) | |
tree | b68806865e112431265632d638466c6f45dae53a /core/variant.cpp | |
parent | 167eb269ec6310d9289a5f33c554af185aa87e9c (diff) | |
parent | 928ca2e1f2136f8e5cc723c1d2389b10f59281eb (diff) |
Merge pull request #24039 from clayjohn/transform_bug
Construct Transform from Transform2D bug
Diffstat (limited to 'core/variant.cpp')
-rw-r--r-- | core/variant.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/core/variant.cpp b/core/variant.cpp index edbe66ba31..eb9f34fee6 100644 --- a/core/variant.cpp +++ b/core/variant.cpp @@ -1662,7 +1662,17 @@ Variant::operator Transform() const { return Transform(*_data._basis, Vector3()); else if (type == QUAT) return Transform(Basis(*reinterpret_cast<const Quat *>(_data._mem)), Vector3()); - else + else if (type == TRANSFORM2D) { + const Transform2D &t = *_data._transform2d; + Transform m; + m.basis.elements[0][0] = t.elements[0][0]; + m.basis.elements[1][0] = t.elements[0][1]; + m.basis.elements[0][1] = t.elements[1][0]; + m.basis.elements[1][1] = t.elements[1][1]; + m.origin[0] = t.elements[2][0]; + m.origin[1] = t.elements[2][1]; + return m; + } else return Transform(); } |