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 QT3DRENDER_RENDER_TRANSFORM_H
5#define QT3DRENDER_RENDER_TRANSFORM_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 <Qt3DRender/private/backendnode_p.h>
19#include <QtGui/qquaternion.h>
20#include <QtGui/qvector3d.h>
21#include <Qt3DCore/private/matrix4x4_p.h>
22
23QT_BEGIN_NAMESPACE
24
25namespace Qt3DRender {
26
27namespace Render {
28
29class Renderer;
30class TransformManager;
31
32class Q_3DRENDERSHARED_PRIVATE_EXPORT Transform : public BackendNode
33{
34public:
35 Transform();
36 void cleanup();
37
38 Matrix4x4 transformMatrix() const;
39 QVector3D scale() const;
40 QQuaternion rotation() const;
41 QVector3D translation() const;
42
43 void syncFromFrontEnd(const Qt3DCore::QNode *frontEnd, bool firstTime) final;
44
45private:
46 void updateMatrix();
47 Matrix4x4 m_transformMatrix;
48 QQuaternion m_rotation;
49 QVector3D m_scale;
50 QVector3D m_translation;
51};
52
53} // namespace Render
54
55} // namespace Qt3DRender
56
57QT_END_NAMESPACE
58
59#endif // QT3DRENDER_RENDER_TRANSFORM_H
60

source code of qt3d/src/render/backend/transform_p.h