1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DNODE_P_P_H
5#define QQUICK3DNODE_P_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 purely as an
12// implementation detail. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18
19#include <QtQuick3D/private/qtquick3dglobal_p.h>
20
21#include "qquick3dobject_p.h"
22#include "qquick3dnode_p.h"
23
24#include <QtQuick3DUtils/private/qssgutils_p.h>
25
26#include <QtGui/QVector3D>
27#include <QtGui/QQuaternion>
28#include <QtGui/QMatrix4x4>
29
30QT_BEGIN_NAMESPACE
31
32class QQuick3DNode;
33
34class Q_QUICK3D_EXPORT QQuick3DNodePrivate : public QQuick3DObjectPrivate
35{
36 Q_DECLARE_PUBLIC(QQuick3DNode)
37
38public:
39
40 explicit QQuick3DNodePrivate(QQuick3DObjectPrivate::Type t);
41 ~QQuick3DNodePrivate();
42 void init();
43
44 void calculateGlobalVariables();
45 void markSceneTransformDirty();
46
47 inline QMatrix4x4 localRotationMatrix() const;
48 inline QMatrix4x4 sceneRotationMatrix() const;
49
50 void emitChangesToSceneTransform();
51 bool isSceneTransformRelatedSignal(const QMetaMethod &signal) const;
52 bool isDirectionRelatedSignal(const QMetaMethod &signal) const;
53
54 void setIsHiddenInEditor(bool isHidden);
55
56 static inline QQuick3DNodePrivate *get(QQuick3DNode *node) { return node->d_func(); }
57
58 void setLocalTransform(const QMatrix4x4 &transform);
59
60 RotationData m_rotation;
61 QVector3D m_position;
62 QVector3D m_scale{ 1.0f, 1.0f, 1.0f };
63 QVector3D m_pivot;
64 float m_opacity = 1.0f;
65 int m_staticFlags = 0;
66 bool m_visible = true;
67 QMatrix4x4 m_sceneTransform; // Right handed
68 QMatrix4x4 m_localTransform; // Right handed
69 bool m_sceneTransformDirty = true;
70 int m_sceneTransformConnectionCount = 0;
71 int m_directionConnectionCount = 0;
72 bool m_isHiddenInEditor = false;
73 bool m_hasInheritedUniformScale = true;
74 bool m_hasExplicitLocalTransform = false;
75};
76
77
78QT_END_NAMESPACE
79
80#endif // QQUICK3DNODE_P_P_H
81
82
83

source code of qtquick3d/src/quick3d/qquick3dnode_p_p.h