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 | |
30 | QT_BEGIN_NAMESPACE |
31 | |
32 | class QQuick3DNode; |
33 | |
34 | class Q_QUICK3D_PRIVATE_EXPORT QQuick3DNodePrivate : public QQuick3DObjectPrivate |
35 | { |
36 | Q_DECLARE_PUBLIC(QQuick3DNode) |
37 | |
38 | public: |
39 | |
40 | explicit QQuick3DNodePrivate(QQuick3DObjectPrivate::Type t); |
41 | ~QQuick3DNodePrivate(); |
42 | void init(); |
43 | |
44 | QMatrix4x4 calculateLocalTransform(); |
45 | void calculateGlobalVariables(); |
46 | void markSceneTransformDirty(); |
47 | |
48 | inline QMatrix4x4 localRotationMatrix() const; |
49 | inline QMatrix4x4 sceneRotationMatrix() const; |
50 | |
51 | void emitChangesToSceneTransform(); |
52 | bool isSceneTransformRelatedSignal(const QMetaMethod &signal) const; |
53 | bool isDirectionRelatedSignal(const QMetaMethod &signal) const; |
54 | |
55 | void setIsHiddenInEditor(bool isHidden); |
56 | |
57 | static inline QQuick3DNodePrivate *get(QQuick3DNode *node) { return node->d_func(); } |
58 | |
59 | RotationData m_rotation; |
60 | QVector3D m_position; |
61 | QVector3D m_scale{ 1.0f, 1.0f, 1.0f }; |
62 | QVector3D m_pivot; |
63 | float m_opacity = 1.0f; |
64 | int m_staticFlags = 0; |
65 | bool m_visible = true; |
66 | QMatrix4x4 m_sceneTransform; // Right handed |
67 | bool m_sceneTransformDirty = true; |
68 | int m_sceneTransformConnectionCount = 0; |
69 | int m_directionConnectionCount = 0; |
70 | bool m_isHiddenInEditor = false; |
71 | bool m_hasInheritedUniformScale = true; |
72 | }; |
73 | |
74 | |
75 | QT_END_NAMESPACE |
76 | |
77 | #endif // QQUICK3DNODE_P_P_H |
78 | |
79 | |
80 | |