| 1 | // Copyright (C) 2019 Klaralvdalens Datakonsult AB (KDAB). |
|---|---|
| 2 | // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only |
| 3 | #ifndef QT3DCORE_SQT_P_H |
| 4 | #define QT3DCORE_SQT_P_H |
| 5 | |
| 6 | // |
| 7 | // W A R N I N G |
| 8 | // ------------- |
| 9 | // |
| 10 | // This file is not part of the Qt API. It exists for the convenience |
| 11 | // of other Qt classes. This header file may change from version to |
| 12 | // version without notice, or even be removed. |
| 13 | // |
| 14 | // We mean it. |
| 15 | // |
| 16 | |
| 17 | #include <QtGui/qmatrix4x4.h> |
| 18 | #include <QtGui/qquaternion.h> |
| 19 | #include <QtGui/qvector3d.h> |
| 20 | #include <QtCore/qlist.h> |
| 21 | #include <private/qglobal_p.h> |
| 22 | |
| 23 | QT_BEGIN_NAMESPACE |
| 24 | |
| 25 | namespace Qt3DCore { |
| 26 | |
| 27 | struct Sqt |
| 28 | { |
| 29 | QQuaternion rotation; |
| 30 | QVector3D scale; |
| 31 | float pad1; |
| 32 | QVector3D translation; |
| 33 | float pad2; |
| 34 | |
| 35 | Sqt() |
| 36 | : rotation() |
| 37 | , scale(1.0f, 1.0f, 1.0f) |
| 38 | , pad1(0.f) |
| 39 | , translation() |
| 40 | , pad2(0.f) |
| 41 | {} |
| 42 | |
| 43 | inline QMatrix4x4 toMatrix() const |
| 44 | { |
| 45 | QMatrix4x4 m; |
| 46 | m.translate(vector: translation); |
| 47 | m.rotate(quaternion: rotation); |
| 48 | m.scale(vector: scale); |
| 49 | return m; |
| 50 | } |
| 51 | |
| 52 | bool operator == (const Sqt &rhs) const |
| 53 | { |
| 54 | return rotation == rhs.rotation |
| 55 | && scale == rhs.scale |
| 56 | && translation == rhs.translation; |
| 57 | } |
| 58 | }; |
| 59 | |
| 60 | struct JointNamesAndLocalPoses |
| 61 | { |
| 62 | QList<QString> names; |
| 63 | QList<Sqt> localPoses; |
| 64 | }; |
| 65 | |
| 66 | } // namespace Qt3DCore |
| 67 | |
| 68 | QT_END_NAMESPACE |
| 69 | |
| 70 | Q_DECLARE_METATYPE(QList<Qt3DCore::Sqt>) |
| 71 | Q_DECLARE_METATYPE(Qt3DCore::JointNamesAndLocalPoses) |
| 72 | |
| 73 | #endif // QT3DCORE_SQT_P_H |
| 74 |
