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// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DXRMANAGER_P_H
7#define QQUICK3DXRMANAGER_P_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 <QtQuick3DXr/private/qtquick3dxrglobal_p.h>
21
22#include <QtCore/QObject>
23#include <QtCore/QVersionNumber>
24#include <QtQml/QQmlEngine>
25#include <QtQml/QQmlComponent>
26
28
29class QQuickWindow;
30class QQuickRenderControl;
31class QQuick3DNode;
32class QQuick3DViewport;
33class QQuick3DXrEyeCamera;
34class QQuick3DXrView;
35class QQuick3DXrOrigin;
37class QRhiTexture;
38class QQuick3DXrAnimationDriver;
39
42
44{
45 Q_OBJECT
46 Q_DECLARE_PRIVATE(QQuick3DXrManager)
47public:
48 explicit QQuick3DXrManager(QObject *parent = nullptr);
50
51 bool isReady() const;
52
53 bool initialize();
54 void teardown();
55
56 bool isValid() const;
57
58 [[nodiscard]] bool setPassthroughEnabled(bool enabled);
59 bool isPassthroughEnabled() const;
60
62 void setFixedFoveationLevel(QtQuick3DXr::FoveationLevel level);
63
65 void setReferenceSpace(QtQuick3DXr::ReferenceSpace newReferenceSpace);
66
67 bool isDepthSubmissionEnabled() const;
68 void setDepthSubmissionEnabled(bool enable);
69
70 QString errorString() const;
71
72 void setSamples(int samples);
73
74 void setMultiViewRenderingEnabled(bool enable);
75 bool isMultiViewRenderingEnabled() const;
77 static bool isMultiviewRenderingDisabled();
78
79 void setXROrigin(QQuick3DXrOrigin *origin);
80
81 void getDefaultClipDistances(float &nearClip, float &farClip) const;
82
83private Q_SLOTS:
84 void update();
85
90 void frameReady();
93
94protected:
95 bool event(QEvent *e) override;
96
97private:
98 friend class QQuick3DXrRuntimeInfo;
99 friend class QQuick3DXrView;
100
101 QQuick3DXrInputManager *getInputManager() const;
102
103 bool setupGraphics();
104
105 void renderFrame();
106
107 void preSetupQuickScene();
108 bool setupQuickScene();
109
110 bool supportsPassthrough() const;
111
112 QQuickWindow *m_quickWindow = nullptr;
113 QQuickRenderControl *m_renderControl = nullptr;
114 QQuick3DViewport *m_vrViewport = nullptr;
115 QQuick3DXrOrigin *m_xrOrigin = nullptr;
116 QQuick3DXrAnimationDriver *m_animationDriver = nullptr;
117 bool m_xrOriginWarningShown = false;
118
119 std::unique_ptr<QQuick3DXrManagerPrivate> d_ptr;
120};
121
122QT_END_NAMESPACE
123
124#endif // QQUICK3DXRMANAGER_P_H
bool event(QEvent *event) override
This virtual function receives events to an object and should return true if the event e was recogniz...
static constexpr QEvent::Type asQEvent(QQuick3DOpenXRThreadWorker::Event event)
static QQuick3DXrInputManagerPrivate * get(QQuick3DXrInputManager *inputManager)
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()
Combined button and popup list for selecting options.
QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(lcQIORing)
#define MAKE_TO_STRING_FUNC(enumType)
static bool isApiLayerSupported(const char *layerName, const QVector< XrApiLayerProperties > &apiLayerProperties)
#define ENUM_CASE_STR(name, val)
static const char s_workerThreadName[]
static QtQuick3DXr::ReferenceSpace getReferenceSpaceType(XrReferenceSpaceType referenceSpace)
static std::pair< XrResult, XrFrameState > waitForNextFrame(XrSession session)
static bool isExtensionSupported(const char *extensionName, const QVector< XrExtensionProperties > &instanceExtensionProperties, uint32_t *extensionVersion=nullptr)