1// Copyright (C) 2014 Klaralvdalens Datakonsult AB (KDAB).
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3
4#ifndef QT3DCORE_QTRANSFORM_P_H
5#define QT3DCORE_QTRANSFORM_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 for the convenience
12// of other Qt classes. This header file may change from version to
13// version without notice, or even be removed.
14//
15// We mean it.
16//
17
18#include <Qt3DCore/private/qcomponent_p.h>
19
20QT_BEGIN_NAMESPACE
21
22namespace Qt3DCore {
23
24class Q_3DCORE_PRIVATE_EXPORT QTransformPrivate : public QComponentPrivate
25{
26 Q_DECLARE_PUBLIC(QTransform)
27
28public:
29 QTransformPrivate();
30 ~QTransformPrivate();
31
32 // Stored in this order as QQuaternion is bigger than QVector3D
33 // Operations are applied in the order of:
34 // scale, rotation, translation
35 QQuaternion m_rotation;
36 QVector3D m_scale;
37 QVector3D m_translation;
38 QVector3D m_eulerRotationAngles;
39
40 mutable QMatrix4x4 m_matrix;
41 mutable bool m_matrixDirty;
42
43 QMatrix4x4 m_worldMatrix;
44
45 bool m_dirty;
46
47 void setWorldMatrix(const QMatrix4x4 &worldMatrix);
48 void update() override;
49};
50
51struct QTransformData
52{
53 QQuaternion rotation;
54 QVector3D scale;
55 QVector3D translation;
56};
57
58} // namespace Qt3DCore
59
60QT_END_NAMESPACE
61
62#endif // QT3DCORE_QTRANSFORM_P_H
63

source code of qt3d/src/core/transforms/qtransform_p.h