Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dskin_p.h
Go to the documentation of this file.
1// Copyright (C) 2022 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5
6#ifndef QSSGSKIN_H
7#define QSSGSKIN_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/qquick3dobject.h>
21#include <QtQuick3D/private/qquick3dnode_p.h>
22#include <QtCore/qlist.h>
23#include <QtCore/qhash.h>
24
26
27class Q_QUICK3D_EXPORT QQuick3DSkin : public QQuick3DObject
28{
29 Q_OBJECT
30 Q_PROPERTY(QQmlListProperty<QQuick3DNode> joints READ joints)
31 Q_PROPERTY(QList<QMatrix4x4> inverseBindPoses READ inverseBindPoses WRITE setInverseBindPoses NOTIFY inverseBindPosesChanged)
32
33 QML_NAMED_ELEMENT(Skin)
34
35public:
36 explicit QQuick3DSkin(QQuick3DObject *parent = nullptr);
37 ~QQuick3DSkin() override;
38
39 QQmlListProperty<QQuick3DNode> joints();
40 QList<QMatrix4x4> inverseBindPoses() const;
41
42public Q_SLOTS:
43 void setInverseBindPoses(const QList<QMatrix4x4> &poses);
44
45Q_SIGNALS:
46 void inverseBindPosesChanged();
47
48private:
49 static void qmlAppendJoint(QQmlListProperty<QQuick3DNode> *list, QQuick3DNode *joint);
50 static QQuick3DNode *qmlJointAt(QQmlListProperty<QQuick3DNode> *list, qsizetype index);
51 static qsizetype qmlJointsCount(QQmlListProperty<QQuick3DNode> *list);
52 static void qmlClearJoints(QQmlListProperty<QQuick3DNode> *list);
53
54 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
55
56 QVector<QQuick3DNode *> m_joints;
57 QByteArray m_boneData;
58 QList<QMatrix4x4> m_inverseBindPoses;
59 using JointConnections = std::pair<QMetaObject::Connection, QMetaObject::Connection>;
60 QHash<QObject *, JointConnections> m_jointsConnections;
61 QSet<QQuick3DNode *> m_dirtyJoints;
62 QSet<QQuick3DNode *> m_removedJoints;
63 int m_updatedByNewInverseBindPoses = 0;
64};
65
66QT_END_NAMESPACE
67
68#endif // QSSGSKIN_H
Combined button and popup list for selecting options.
#define POS4BONETRANS(x)
#define POS4BONENORM(x)