1// Copyright (C) 2024 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef QOPENXRHELPERS_H
5#define QOPENXRHELPERS_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
19#include <openxr/openxr.h>
20#include <QtQuick3DXr/qtquick3dxrglobal.h>
21#include <QQuaternion>
22#include <QString>
23#include <QVector3D>
24
25QT_BEGIN_NAMESPACE
26
27namespace OpenXRHelpers
28{
29QString getXrResultAsString(XrResult result, XrInstance instance);
30bool checkXrResult(XrResult result, XrInstance instance);
31
32inline QQuaternion toQQuaternion(const XrQuaternionf &q)
33{
34 return { q.w, q.x, q.y, q.z };
35}
36
37inline QVector3D toQVector(const XrVector3f &v)
38{
39 return { v.x * 100, v.y * 100, v.z * 100 };
40}
41}
42
43QT_END_NAMESPACE
44
45#endif // QOPENXRHELPERS_H
46

source code of qtquick3d/src/xr/quick3dxr/openxr/qopenxrhelpers_p.h