Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dperspectivecamera_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// Qt-Security score:significant reason:default
4
5
6#ifndef QSSGPERSPECTIVECAMERA_H
7#define QSSGPERSPECTIVECAMERA_H
8
9//
10// W A R N I N G
11// -------------
12//
13// This file is not part of the Qt API. It exists purely as an
14// implementation detail. This header file may change from version to
15// version without notice, or even be removed.
16//
17// We mean it.
18//
19
20#include <QtQuick3D/private/qquick3dcamera_p.h>
21
22QT_BEGIN_NAMESPACE
23
24class QSSGRenderCamera;
25class Q_QUICK3D_EXPORT QQuick3DPerspectiveCamera : public QQuick3DCamera
26{
27 Q_OBJECT
28 Q_PROPERTY(float clipNear READ clipNear WRITE setClipNear NOTIFY clipNearChanged)
29 Q_PROPERTY(float clipFar READ clipFar WRITE setClipFar NOTIFY clipFarChanged)
30 Q_PROPERTY(float fieldOfView READ fieldOfView WRITE setFieldOfView NOTIFY fieldOfViewChanged)
31 Q_PROPERTY(FieldOfViewOrientation fieldOfViewOrientation READ fieldOfViewOrientation WRITE setFieldOfViewOrientation NOTIFY fieldOfViewOrientationChanged)
32
33 QML_NAMED_ELEMENT(PerspectiveCamera)
34
35public:
36 enum FieldOfViewOrientation {
37 Vertical,
38 Horizontal
39 };
40 Q_ENUM(FieldOfViewOrientation)
41
42 explicit QQuick3DPerspectiveCamera(QQuick3DNode *parent = nullptr);
43
44 float clipNear() const;
45 float clipFar() const;
46 float fieldOfView() const;
47 FieldOfViewOrientation fieldOfViewOrientation() const;
48
49public Q_SLOTS:
50 void setClipNear(float clipNear);
51 void setClipFar(float clipFar);
52 void setFieldOfView(float fieldOfView);
53 void setFieldOfViewOrientation(QQuick3DPerspectiveCamera::FieldOfViewOrientation fieldOfViewOrientation);
54
55Q_SIGNALS:
56 void clipNearChanged();
57 void clipFarChanged();
58 void fieldOfViewChanged();
59 void fieldOfViewOrientationChanged();
60
61protected:
62 explicit QQuick3DPerspectiveCamera(QQuick3DNodePrivate &dd, QQuick3DNode *parent = nullptr);
63 QSSGRenderGraphObject *updateSpatialNode(QSSGRenderGraphObject *node) override;
64
65private:
66 float m_clipNear = 10.0f;
67 float m_clipFar = 10000.0f;
68 float m_fieldOfView = 60.0f;
69 FieldOfViewOrientation m_fieldOfViewOrientation = Vertical;
70};
71
72QT_END_NAMESPACE
73
74#endif // QSSGPERSPECTIVECAMERA_H
Combined button and popup list for selecting options.