// Copyright (C) 2022 The Qt Company Ltd. // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only #ifndef QSSGSKIN_H #define QSSGSKIN_H // // W A R N I N G // ------------- // // This file is not part of the Qt API. It exists purely as an // implementation detail. This header file may change from version to // version without notice, or even be removed. // // We mean it. // #include #include #include #include QT_BEGIN_NAMESPACE class Q_QUICK3D_EXPORT QQuick3DSkin : public QQuick3DObject { Q_OBJECT Q_PROPERTY(QQmlListProperty joints READ joints) Q_PROPERTY(QList inverseBindPoses READ inverseBindPoses WRITE setInverseBindPoses NOTIFY inverseBindPosesChanged) QML_NAMED_ELEMENT(Skin) public: explicit QQuick3DSkin(QQuick3DObject *parent = nullptr); ~QQuick3DSkin() override; QQmlListProperty joints(); QList inverseBindPoses() const; public Q_SLOTS: void setInverseBindPoses(const QList &poses); Q_SIGNALS: void inverseBindPosesChanged(); private: static void qmlAppendJoint(QQmlListProperty *list, QQuick3DNode *joint); static QQuick3DNode *qmlJointAt(QQmlListProperty *list, qsizetype index); static qsizetype qmlJointsCount(QQmlListProperty *list); static void qmlClearJoints(QQmlListProperty *list); QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override; QVector m_joints; QByteArray m_boneData; QList m_inverseBindPoses; using JointConnections = std::pair; QHash m_jointsConnections; QSet m_dirtyJoints; QSet m_removedJoints; int m_updatedByNewInverseBindPoses = 0; }; QT_END_NAMESPACE #endif // QSSGSKIN_H