| 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_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 | void setLocalTransform(const QMatrix4x4 &transform); |
| 60 | |
| 61 | RotationData m_rotation; |
| 62 | QVector3D m_position; |
| 63 | QVector3D m_scale{ 1.0f, 1.0f, 1.0f }; |
| 64 | QVector3D m_pivot; |
| 65 | float m_opacity = 1.0f; |
| 66 | int m_staticFlags = 0; |
| 67 | bool m_visible = true; |
| 68 | QMatrix4x4 m_sceneTransform; // Right handed |
| 69 | QMatrix4x4 m_localTransform; // Right handed |
| 70 | bool m_sceneTransformDirty = true; |
| 71 | int m_sceneTransformConnectionCount = 0; |
| 72 | int m_directionConnectionCount = 0; |
| 73 | bool m_isHiddenInEditor = false; |
| 74 | bool m_hasInheritedUniformScale = true; |
| 75 | bool m_hasExplicitLocalTransform = false; |
| 76 | }; |
| 77 | |
| 78 | |
| 79 | QT_END_NAMESPACE |
| 80 | |
| 81 | #endif // QQUICK3DNODE_P_P_H |
| 82 | |
| 83 | |
| 84 | |