Qt
Internal/Contributor docs for the Qt SDK. <b>Note:</b> These are NOT official API docs; those are found <a href='https://doc.qt.io/'>here</a>.
Loading...
Searching...
No Matches
qquick3dxrcontroller_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 QQUICK3DXRCONTROLLER_H
5#define QQUICK3DXRCONTROLLER_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/qtquick3dxrglobal.h>
20#include <QtQuick3D/private/qquick3dnode_p.h>
21#include <QtQml/QQmlEngine>
22
24
26
27class Q_QUICK3DXR_EXPORT QQuick3DXrController : public QQuick3DNode
28{
30 Q_PROPERTY(Controller controller READ controller WRITE setController NOTIFY controllerChanged FINAL)
31 Q_PROPERTY(bool isActive READ isActive NOTIFY isActiveChanged FINAL)
32 Q_PROPERTY(HandPoseSpace poseSpace READ poseSpace WRITE setPoseSpace NOTIFY poseSpaceChanged FINAL)
33
34 Q_PROPERTY(QVector3D pokePosition READ pokePosition NOTIFY pokePositionChanged FINAL)
35 Q_PROPERTY(QList<QVector3D> jointPositions READ jointPositions NOTIFY jointPositionsChanged FINAL)
36 Q_PROPERTY(QList<QQuaternion> jointRotations READ jointRotations NOTIFY jointRotationsChanged FINAL)
37
38 QML_NAMED_ELEMENT(XrController)
40public:
42 ControllerNone = 0,
43 ControllerLeft = 1,
44 ControllerRight = 2,
45 };
47
48 enum class HandPoseSpace {
49 GripPose,
50 AimPose
51 };
52 Q_ENUM(HandPoseSpace)
53
55
56 QQuick3DXrController::Controller controller() const;
57 void setController(QQuick3DXrController::Controller newController);
58
59 QQuick3DXrHandInput *handInput() const;
60
61 HandPoseSpace poseSpace() const;
62 void setPoseSpace(HandPoseSpace newPoseSpace);
63
64 QVector3D pokePosition() const;
65
66 QList<QVector3D> jointPositions() const;
67 QList<QQuaternion> jointRotations() const;
68
69 bool isActive() const;
70
75
77
79
83
85
86private:
87 QPointer<QQuick3DXrInputManager> m_inputManager;
88 Controller m_controller = ControllerNone;
89 QMetaObject::Connection m_posePositionConnection;
90 QMetaObject::Connection m_poseRotationConnection;
91 QMetaObject::Connection m_isActiveConnection;
92 QMetaObject::Connection m_inputActionConnection;
93 HandPoseSpace m_poseSpace;
94 QVector3D m_pokePosition;
95 bool m_isActive;
96};
97
99
100#endif // QQUICK3DXRCONTROLLER_H
bool isActive
Definition qlist.h:76
\inmodule QtCore Represents a handle to a signal-slot (or signal-functor) connection.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
#define QML_NAMED_ELEMENT(NAME)
#define QML_ADDED_IN_VERSION(MAJOR, MINOR)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SIGNALS