construct transform from transform2d bug
This commit is contained in:
parent
60cbb69c7c
commit
928ca2e1f2
1 changed files with 11 additions and 1 deletions
|
@ -1662,7 +1662,17 @@ Variant::operator Transform() const {
|
||||||
return Transform(*_data._basis, Vector3());
|
return Transform(*_data._basis, Vector3());
|
||||||
else if (type == QUAT)
|
else if (type == QUAT)
|
||||||
return Transform(Basis(*reinterpret_cast<const Quat *>(_data._mem)), Vector3());
|
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();
|
return Transform();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue