aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick3d/qquick3djoint_p.h
blob: 311c0ba34b61efcdbb1c03ef31d81c6f961c2b57 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
// Copyright (C) 2020 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only

#ifndef QSSGJOINT_H
#define QSSGJOINT_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 <QtQuick3D/private/qquick3dnode_p.h>
#include <QtQuick3D/private/qquick3dskeleton_p.h>

#include <QtQuick3DRuntimeRender/private/qssgrenderskeleton_p.h>

QT_BEGIN_NAMESPACE

class Q_QUICK3D_EXPORT QQuick3DJoint : public QQuick3DNode
{
    Q_OBJECT
    Q_PROPERTY(qint32 index READ index WRITE setIndex NOTIFY indexChanged)
    Q_PROPERTY(QQuick3DSkeleton *skeletonRoot READ skeletonRoot WRITE setSkeletonRoot NOTIFY skeletonRootChanged)

    QML_NAMED_ELEMENT(Joint)

public:
    explicit QQuick3DJoint(QQuick3DNode *parent = nullptr);
    ~QQuick3DJoint() override;

    qint32 index() const;
    QQuick3DSkeleton *skeletonRoot() const;

public Q_SLOTS:
    void setIndex(qint32 index);
    void setSkeletonRoot(QQuick3DSkeleton *skeleton);

Q_SIGNALS:
    void indexChanged();
    void skeletonRootChanged();

protected:
    QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
    void markAllDirty() override;

private Q_SLOTS:

private:
    bool m_indexDirty = true;
    bool m_skeletonRootDirty = true;
    int m_index = 0;

    QQuick3DSkeleton *m_skeletonRoot = nullptr;

    QMetaObject::Connection m_skeletonConnection;
};

QT_END_NAMESPACE

#endif // QSSGJOINT_H