diff options
author | Yuya Nishihara <yuya.nishihara@qt.io> | 2021-07-16 12:37:29 +0900 |
---|---|---|
committer | Yuya Nishihara <yuya.nishihara@qt.io> | 2021-08-10 09:30:32 +0900 |
commit | ebad2bf18d10f96096d11fa1e2c1851270d2071d (patch) | |
tree | 2f900d81e64d501264f6b07f54760307fb3899cf /tests/auto/qml/qqmlvaluetypes | |
parent | 3cf2df4a7e8a53a63068613311c4799e55c971b9 (diff) |
Add overload of rotate(quaternion) to matrix4x4
In QtQuick3D, quaternion is the canonical form of rotation. This provides
a way to compose arbitrary transform matrix by using Node.rotation value.
Change-Id: I63bf1350875e8ea6f53a1451a7f602d73c673d31
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
Reviewed-by: Ulf Hermann <ulf.hermann@qt.io>
Diffstat (limited to 'tests/auto/qml/qqmlvaluetypes')
-rw-r--r-- | tests/auto/qml/qqmlvaluetypes/data/matrix4x4_invokables.qml | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/auto/qml/qqmlvaluetypes/data/matrix4x4_invokables.qml b/tests/auto/qml/qqmlvaluetypes/data/matrix4x4_invokables.qml index 09f1d472b7..332a09c152 100644 --- a/tests/auto/qml/qqmlvaluetypes/data/matrix4x4_invokables.qml +++ b/tests/auto/qml/qqmlvaluetypes/data/matrix4x4_invokables.qml @@ -44,7 +44,14 @@ Item { m.rotate(180, Qt.vector3d(0, 0, 1)); if (m !== Qt.matrix4x4()) return false; + m.rotate(Qt.quaternion(0.5, 0.5, 0.5, -0.5)); + if (m !== Qt.matrix4x4(0, 1, 0, 0, + 0, 0, -1, 0, + -1, 0, 0, 0, + 0, 0, 0, 1)) + return false; + m = Qt.matrix4x4(); m.translate(Qt.vector3d(1, 2, 4)); if (m !== Qt.matrix4x4(1, 0, 0, 1, 0, 1, 0, 2, |