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
qopenxrhandtrackerinput_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 QOPENXRHANDTRACKERINPUT_H
5#define QOPENXRHANDTRACKERINPUT_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 <QObject>
19#include <QVector2D>
20#include <QVector3D>
21#include <QQuaternion>
22#include <QtQml/qqml.h>
23#include <private/qquick3dmodel_p.h>
24
25#include <QQuick3DGeometry>
26
28
30{
34
36
39
41
42 QML_NAMED_ELEMENT(XrHandTrackerInput)
43 QML_UNCREATABLE("Created by XrView")
44
45public:
46 enum class HandPoseSpace {
48 AimPose,
51 };
53
54 explicit QOpenXRHandTrackerInput(QObject *parent = nullptr);
55
56 bool isActive() const;
58 void setIsActive(bool isActive);
59
60 const QVector3D &posePosition() const;
61 const QQuaternion &poseRotation() const;
62
63 QList<QVector3D> jointPositions() const;
64 void setJointPositionsAndRotations(const QList<QVector3D> &newJointPositions, const QList<QQuaternion> &newJointRotations);
65
66 QList<QQuaternion> jointRotations() const;
67
68 QVector3D pokePosition() const;
69 void setPokePosition(const QVector3D &newPokePosition);
70
71public Q_SLOTS:
73
77
80
83
85
87
88private:
89 bool m_isActive = false;
91
92 QVector3D m_posePosition;
93 QQuaternion m_poseRotation;
94
95 QList<QVector3D> m_jointPositions;
96 QList<QQuaternion> m_jointRotations;
97 QVector3D m_pokePosition;
98};
99
101{
103
105
106 QML_NAMED_ELEMENT(XrHandModel)
107
108public:
110
111 void componentComplete() override;
112
114 void setHandTracker(QOpenXRHandTrackerInput *newHandTracker);
115
119
120private Q_SLOTS:
121 void updatePose();
122
123private:
124 void setupModel();
125 QOpenXRHandTrackerInput *m_handTracker = nullptr;
126 bool m_initialized = false;
127};
128
130
131#endif // QOPENXRHANDTRACKERINPUT_H
Definition qlist.h:75
\inmodule QtCore
Definition qobject.h:103
QObject * parent() const
Returns a pointer to the parent object.
Definition qobject.h:346
QList< QQuaternion > jointRotations
void setPokePosition(const QVector3D &newPokePosition)
void setPoseSpace(HandPoseSpace poseSpace)
QOpenXRHandTrackerInput(QObject *parent=nullptr)
const QQuaternion & poseRotation() const
void setJointPositionsAndRotations(const QList< QVector3D > &newJointPositions, const QList< QQuaternion > &newJointRotations)
void handTrackerChanged()
QOpenXrHandModel(QQuick3DNode *parent=nullptr)
QOpenXRHandTrackerInput * handTracker
void setHandTracker(QOpenXRHandTrackerInput *newHandTracker)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
QQuick3DObject * parent
\qmlproperty Object3D QtQuick3D::Object3D::parent This property holds the parent of the Object3D in a...
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
GLbyte by
#define QML_UNCREATABLE(REASON)
#define QML_NAMED_ELEMENT(NAME)
#define Q_ENUM(x)
#define Q_PROPERTY(...)
#define Q_OBJECT
#define Q_SLOTS
#define Q_SIGNALS