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
qquick3dxrmanager_p.h
Go to the documentation of this file.
1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QQUICK3DXRMANAGER_P_H
5#define QQUICK3DXRMANAGER_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#include <QtQuick3DXr/private/qtquick3dxrglobal_p.h>
19
20#include <QtCore/QObject>
21#include <QtCore/QVersionNumber>
22#include <QtQml/QQmlEngine>
23#include <QtQml/QQmlComponent>
24
26
27class QQuickWindow;
28class QQuickRenderControl;
29class QQuick3DNode;
30class QQuick3DViewport;
31class QQuick3DXrEyeCamera;
32class QQuick3DXrView;
33class QQuick3DXrOrigin;
35class QRhiTexture;
36class QQuick3DXrAnimationDriver;
37
40
42{
43 Q_OBJECT
44 Q_DECLARE_PRIVATE(QQuick3DXrManager)
45public:
46 explicit QQuick3DXrManager(QObject *parent = nullptr);
48
49 bool isReady() const;
50
51 bool initialize();
52 void teardown();
53
54 bool isValid() const;
55
56 [[nodiscard]] bool setPassthroughEnabled(bool enabled);
57 bool isPassthroughEnabled() const;
58
60 void setFixedFoveationLevel(QtQuick3DXr::FoveationLevel level);
61
63 void setReferenceSpace(QtQuick3DXr::ReferenceSpace newReferenceSpace);
64
65 bool isDepthSubmissionEnabled() const;
66 void setDepthSubmissionEnabled(bool enable);
67
68 QString errorString() const;
69
70 void setSamples(int samples);
71
72 void setMultiViewRenderingEnabled(bool enable);
73 bool isMultiViewRenderingEnabled() const;
75 static bool isMultiviewRenderingDisabled();
76
77 void setXROrigin(QQuick3DXrOrigin *origin);
78
79 void getDefaultClipDistances(float &nearClip, float &farClip) const;
80
81private Q_SLOTS:
82 void update();
83
88 void frameReady();
91
92protected:
93 bool event(QEvent *e) override;
94
95private:
96 friend class QQuick3DXrRuntimeInfo;
97 friend class QQuick3DXrView;
98
99 QQuick3DXrInputManager *getInputManager() const;
100
101 bool setupGraphics();
102
103 void renderFrame();
104
105 void preSetupQuickScene();
106 bool setupQuickScene();
107
108 bool supportsPassthrough() const;
109
110 QQuickWindow *m_quickWindow = nullptr;
111 QQuickRenderControl *m_renderControl = nullptr;
112 QQuick3DViewport *m_vrViewport = nullptr;
113 QQuick3DXrOrigin *m_xrOrigin = nullptr;
114 QQuick3DXrAnimationDriver *m_animationDriver = nullptr;
115 bool m_xrOriginWarningShown = false;
116
117 std::unique_ptr<QQuick3DXrManagerPrivate> d_ptr;
118};
119
120QT_END_NAMESPACE
121
122#endif // QQUICK3DXRMANAGER_P_H
QQuick3DXrManagerPrivate(QQuick3DXrManager &manager)
void setupWindow(QQuickWindow *window)
QtQuick3DXr::ReferenceSpace getReferenceSpace() const
void setReferenceSpace(QtQuick3DXr::ReferenceSpace newReferenceSpace)
bool setupGraphics(QQuickWindow *window)
static QQuick3DXrManagerPrivate * get(QQuick3DXrManager *manager)
void getDefaultClipDistances(float &nearClip, float &farClip) const
void setDepthSubmissionEnabled(bool enable)
bool isPassthroughEnabled() const
void multiViewRenderingEnabledChanged()
void setFixedFoveationLevel(QtQuick3DXr::FoveationLevel level)
bool isMultiViewRenderingSupported() const
QString errorString() const
QtQuick3DXr::FoveationLevel getFixedFoveationLevel() const
bool isDepthSubmissionEnabled() const
void setMultiViewRenderingEnabled(bool enable)
void referenceSpaceChanged()
void setSamples(int samples)
void setXROrigin(QQuick3DXrOrigin *origin)
bool isMultiViewRenderingEnabled() const
void getDefaultClipDistances(float &nearClip, float &farClip) const
void setReferenceSpace(QtQuick3DXr::ReferenceSpace newReferenceSpace)
bool setPassthroughEnabled(bool enabled)
bool event(QEvent *e) override
This virtual function receives events to an object and should return true if the event e was recogniz...
QtQuick3DXr::ReferenceSpace getReferenceSpace() const
static bool isMultiviewRenderingDisabled()
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcEventDispatcher)
#define MAKE_TO_STRING_FUNC(enumType)
static bool isApiLayerSupported(const char *layerName, const QVector< XrApiLayerProperties > &apiLayerProperties)
#define ENUM_CASE_STR(name, val)
static QtQuick3DXr::ReferenceSpace getReferenceSpaceType(XrReferenceSpaceType referenceSpace)
static bool isExtensionSupported(const char *extensionName, const QVector< XrExtensionProperties > &instanceExtensionProperties, uint32_t *extensionVersion=nullptr)