Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dcamera_p.h
Go to the documentation of this file.
1// Copyright (C) 2019 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QSSGCAMERA_H
5#define QSSGCAMERA_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#include <QtQuick3D/private/qquick3dnode_p.h>
19
21
22struct QSSGRenderCamera;
23class Q_QUICK3D_EXPORT QQuick3DCamera : public QQuick3DNode
24{
26 Q_PROPERTY(bool frustumCullingEnabled READ frustumCullingEnabled WRITE setFrustumCullingEnabled NOTIFY frustumCullingEnabledChanged)
27 Q_PROPERTY(QQuick3DNode *lookAtNode READ lookAtNode WRITE setLookAtNode NOTIFY lookAtNodeChanged REVISION(6, 4))
28 Q_PROPERTY(float levelOfDetailBias READ levelOfDetailBias WRITE setLevelOfDetailBias NOTIFY levelOfDetailBiasChanged REVISION(6, 5))
29 QML_NAMED_ELEMENT(Camera)
30 QML_UNCREATABLE("Camera is Abstract")
31public:
32 Q_INVOKABLE QVector3D mapToViewport(const QVector3D &scenePos) const;
33 Q_INVOKABLE QVector3D mapFromViewport(const QVector3D &viewportPos) const;
34 QVector3D mapToViewport(const QVector3D &scenePos,
37 QVector3D mapFromViewport(const QVector3D &viewportPos,
40
41 Q_INVOKABLE void lookAt(const QVector3D &scenePos);
42 Q_INVOKABLE void lookAt(QQuick3DNode *node);
43
44 // It will be used only after the scene was drawn.
45 // It means that the spatialNode of this camera already was created.
46 void updateGlobalVariables(const QRectF &inViewport);
47
48 bool frustumCullingEnabled() const;
49 QQuick3DNode *lookAtNode() const;
50 Q_REVISION(6, 5) float levelOfDetailBias() const;
51
52public Q_SLOTS:
53 void setFrustumCullingEnabled(bool frustumCullingEnabled);
54 void setLookAtNode(QQuick3DNode *node);
55 Q_REVISION(6, 5) void setLevelOfDetailBias(float newLevelOFDetailBias);
56
58 void frustumCullingEnabledChanged();
59 Q_REVISION(6, 4) void lookAtNodeChanged();
60 Q_REVISION(6, 5) void levelOfDetailBiasChanged();
61
62protected:
64
65 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
66
68 void updateLookAt();
69
71 bool m_frustumCullingEnabled = false;
72 QQuick3DNode *m_lookAtNode = nullptr;
73 float m_levelOfDetailBias = 1.0f;
74};
75
77
78#endif // QSSGCAMERA_H
\inmodule QtCore\reentrant
Definition qrect.h:484
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLint GLsizei GLsizei height
GLfloat GLfloat f
GLint GLsizei width
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_REVISION(...)
#define Q_INVOKABLE
#define Q_SLOTS
#define Q_SIGNALS
double qreal
Definition qtypes.h:187
#define explicit