blob: 28d555355751531e88ee5b268a786a749b5605e9 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
|
// Copyright (C) 2024 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
#include "qquick3dxrinputmanager_p.h"
#if defined(Q_OS_VISIONOS)
# include "visionos/qquick3dxrinputmanager_visionos_p.h"
#else
# include "openxr/qopenxrinputmanager_p.h"
#endif
#include "qquick3dxrcontroller_p.h"
QT_BEGIN_NAMESPACE
QQuick3DXrInputManager *QQuick3DXrInputManager::instance()
{
static QQuick3DXrInputManager instance;
return &instance;
}
QQuick3DXrHandInput *QQuick3DXrInputManager::leftHandInput() const
{
Q_D(const QQuick3DXrInputManager);
return d->leftHandInput();
}
QQuick3DXrHandInput *QQuick3DXrInputManager::rightHandInput() const
{
Q_D(const QQuick3DXrInputManager);
return d->rightHandInput();
}
void QQuick3DXrInputManager::registerController(QQuick3DXrController *controller)
{
Q_D(QQuick3DXrInputManager);
connect(controller, &QObject::destroyed, this, [this](QObject *obj) { unregisterController(static_cast<QQuick3DXrController *>(obj)); });
d->registerController(controller);
}
void QQuick3DXrInputManager::unregisterController(QQuick3DXrController *controller)
{
Q_D(QQuick3DXrInputManager);
d->unregisterController(controller);
}
bool QQuick3DXrInputManager::isValid() const
{
Q_D(const QQuick3DXrInputManager);
return d->isValid();
}
QQuick3DXrInputManager::QQuick3DXrInputManager(QObject *parent)
: QObject(parent)
, d_ptr(new QQuick3DXrInputManagerPrivate(*this))
{
}
QQuick3DXrInputManager::~QQuick3DXrInputManager()
{
}
QT_END_NAMESPACE
|