40 Q_PROPERTY(QQuick3DXrOrigin *xrOrigin READ xrOrigin WRITE setXROrigin NOTIFY xrOriginChanged)
41 Q_PROPERTY(QQuick3DSceneEnvironment *environment READ environment WRITE setEnvironment NOTIFY environmentChanged)
42 Q_PROPERTY(
bool passthroughSupported READ passthroughSupported CONSTANT)
43 Q_PROPERTY(
bool passthroughEnabled READ passthroughEnabled WRITE setPassthroughEnabled NOTIFY passthroughEnabledChanged FINAL)
44 Q_PROPERTY(QQuick3DXrRuntimeInfo *runtimeInfo READ runtimeInfo CONSTANT)
45 Q_PROPERTY(
bool quitOnSessionEnd READ isQuitOnSessionEndEnabled WRITE setQuitOnSessionEnd NOTIFY quitOnSessionEndChanged FINAL)
46 Q_PROPERTY(QQuick3DRenderStats *renderStats READ renderStats CONSTANT)
47 Q_PROPERTY(FoveationLevel fixedFoveation READ fixedFoveation WRITE setFixedFoveation NOTIFY fixedFoveationChanged FINAL)
48 Q_PROPERTY(ReferenceSpace referenceSpace READ referenceSpace WRITE setReferenceSpace NOTIFY referenceSpaceChanged FINAL)
49 Q_PROPERTY(
bool depthSubmissionEnabled READ depthSubmissionEnabled WRITE setDepthSubmissionEnabled NOTIFY depthSubmissionEnabledChanged FINAL)
50 Q_PROPERTY(
bool multiViewRenderingSupported READ isMultiViewRenderingSupported CONSTANT)
51 Q_PROPERTY(
bool multiViewRenderingEnabled READ multiViewRenderingEnabled NOTIFY multiViewRenderingEnabledChanged FINAL)
52 QML_NAMED_ELEMENT(XrView)
53 QML_ADDED_IN_VERSION(6, 8)
62 Q_ENUM(FoveationLevel)
64 enum class ReferenceSpace {
65 ReferenceSpaceUnknown,
68 ReferenceSpaceLocalFloor
70 Q_ENUM(ReferenceSpace)
72 explicit QQuick3DXrView();
75 QQuick3DXrOrigin *xrOrigin()
const;
76 QQuick3DSceneEnvironment *environment()
const;
78 bool passthroughSupported()
const;
79 bool passthroughEnabled()
const;
81 FoveationLevel fixedFoveation()
const;
82 void setFixedFoveation(FoveationLevel level);
84 QQuick3DXrRuntimeInfo *runtimeInfo()
const;
86 bool isQuitOnSessionEndEnabled()
const;
88 QQuick3DRenderStats *renderStats()
const;
90 Q_INVOKABLE QQuick3DPickResult rayPick(
const QVector3D &origin,
const QVector3D &direction)
const;
91 Q_INVOKABLE QList<QQuick3DPickResult> rayPickAll(
const QVector3D &origin,
const QVector3D &direction)
const;
92 Q_REVISION(6, 11) Q_INVOKABLE QQuick3DPickResult rayPick(
const QVector3D &origin,
const QVector3D &direction, QQuick3DModel *model)
const;
94 Q_INVOKABLE
void setTouchpoint(QQuickItem *target,
const QPointF &position,
int pointId,
bool active);
95 Q_INVOKABLE QVector3D processTouch(
const QVector3D &pos,
int pointId);
96 Q_INVOKABLE QVariantMap touchpointState(
int pointId)
const;
98 ReferenceSpace referenceSpace()
const;
99 void setReferenceSpace(ReferenceSpace newReferenceSpace);
101 bool depthSubmissionEnabled()
const;
103 void registerXrItem(QQuick3DXrItem *newXrItem);
104 void unregisterXrItem(QQuick3DXrItem *xrItem);
106 bool isMultiViewRenderingSupported()
const;
107 bool multiViewRenderingEnabled()
const;
109 QQuick3DXrManager *xrManager() {
return &m_xrManager; }
112 void setEnvironment(QQuick3DSceneEnvironment * environment);
113 void setPassthroughEnabled(
bool enable);
114 void setQuitOnSessionEnd(
bool enable);
115 void setDepthSubmissionEnabled(
bool enable);
116 void setXROrigin(QQuick3DXrOrigin *newXrOrigin);
119 void updateViewportGeometry();
120 void handleSessionEnded();
121 void handleClearColorChanged();
122 void handleAAChanged();
126 void initializeFailed(
const QString &errorString);
128 void xrOriginChanged();
129 void environmentChanged(QQuick3DSceneEnvironment * environment);
130 void passthroughEnabledChanged();
131 void quitOnSessionEndChanged();
132 void fixedFoveationChanged();
134 void referenceSpaceChanged();
135 void depthSubmissionEnabledChanged();
136 void multiViewRenderingEnabledChanged();
139 friend class QQuick3DXrViewPrivate;
141 QQuick3DViewport *view3d()
const;
143 QPointer<QQuick3DSceneEnvironment> m_pendingSceneEnvironment;
144 QQuick3DXrManager m_xrManager;
145 mutable QQuick3DXrRuntimeInfo m_xrRuntimeInfo;
146 bool m_quitOnSessionEnd =
true;
147 bool m_inDestructor =
false;
148 bool m_isInitialized =
false;
150 friend class QQuick3DXrVirtualMouse;
151 QList<QQuick3DXrItem *> m_xrItems;
153 XrTouchState *m_touchState =
nullptr;
154 QQuick3DXrOrigin *m_xrOrigin =
nullptr;