| 1 | // Copyright (C) 2017 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 | |
| 4 | #ifndef QT3DRENDER_RENDER_SKELETONDATA_P_H |
| 5 | #define QT3DRENDER_RENDER_SKELETONDATA_P_H |
| 6 | |
| 7 | // |
| 8 | // W A R N I N G |
| 9 | // ------------- |
| 10 | // |
| 11 | // This file is not part of the Qt API. It exists for the convenience |
| 12 | // of other Qt classes. This header file may change from version to |
| 13 | // version without notice, or even be removed. |
| 14 | // |
| 15 | // We mean it. |
| 16 | // |
| 17 | |
| 18 | #include <Qt3DCore/qnodeid.h> |
| 19 | #include <QtGui/qmatrix4x4.h> |
| 20 | #include <QtCore/qlist.h> |
| 21 | #include <QtCore/qstring.h> |
| 22 | #include <Qt3DCore/private/sqt_p.h> |
| 23 | |
| 24 | #include <Qt3DRender/private/handle_types_p.h> |
| 25 | #include <Qt3DRender/private/joint_p.h> |
| 26 | |
| 27 | QT_BEGIN_NAMESPACE |
| 28 | |
| 29 | namespace Qt3DRender { |
| 30 | namespace Render { |
| 31 | |
| 32 | struct Q_AUTOTEST_EXPORT JointInfo |
| 33 | { |
| 34 | JointInfo() |
| 35 | : parentIndex(-1) |
| 36 | { |
| 37 | } |
| 38 | |
| 39 | explicit JointInfo(Joint *joint, int parentJointIndex) |
| 40 | : inverseBindPose(joint->inverseBindMatrix()) |
| 41 | , parentIndex(parentJointIndex) |
| 42 | { |
| 43 | } |
| 44 | |
| 45 | QMatrix4x4 inverseBindPose; |
| 46 | QMatrix4x4 globalPose; |
| 47 | int parentIndex; |
| 48 | }; |
| 49 | |
| 50 | struct Q_AUTOTEST_EXPORT SkeletonData |
| 51 | { |
| 52 | SkeletonData(); |
| 53 | |
| 54 | void reserve(int size); |
| 55 | |
| 56 | QVector<JointInfo> joints; |
| 57 | QVector<Qt3DCore::Sqt> localPoses; |
| 58 | QVector<QString> jointNames; |
| 59 | QHash<HJoint, int> jointIndices; |
| 60 | }; |
| 61 | |
| 62 | } // namespace Render |
| 63 | } // namespace Qt3DRender |
| 64 | |
| 65 | QT_END_NAMESPACE |
| 66 | |
| 67 | #endif // QT3DRENDER_RENDER_SKELETONDATA_P_H |
| 68 | |