Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qquick3dxrinputmanager_visionos_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// Qt-Security score:significant reason:default
4
5
6#ifndef QQUICK3DXINPUTMANAGER_VISIONOS_P_H
7#define QQUICK3DXINPUTMANAGER_VISIONOS_P_H
8
9#include <QtQuick3DXr/private/qtquick3dxrglobal_p.h>
10
11#include <QtGui/qquaternion.h>
12
13#ifdef __OBJC__
14#import <ARKit/ARKit.h>
15#else
17typedef struct ar_hand_tracking_provider_s *ar_hand_tracking_provider_t;
18typedef struct ar_data_providers_s *ar_data_providers_t;
19#endif
20
21//
22// W A R N I N G
23// -------------
24//
25// This file is not part of the Qt API. It exists purely as an
26// implementation detail. This header file may change from version to
27// version without notice, or even be removed.
28//
29// We mean it.
30//
31
32QT_BEGIN_NAMESPACE
33
34class QQuick3DXrHandInput;
37class QQuick3DXrController;
38class QQuick3DViewport;
39
41{
42 Q_DECLARE_PUBLIC(QQuick3DXrInputManager)
43public:
46
49
50 // Two step process
51 // 1.
52 void prepareHandtracking(ar_data_providers_t dataProviders);
53 // 2.
54 void initHandtracking();
55
56 void teardown();
57
58 bool isValid() const { return m_initialized; }
59
61
62 void setPosePositionAndRotation(Hand hand, HandPoseSpace poseSpace, const QVector3D &position, const QQuaternion &rotation);
63
64 void registerController(QQuick3DXrController *controller);
65 void unregisterController(QQuick3DXrController *controller);
66
67 bool isPoseInUse(Hand hand, HandPoseSpace poseSpace);
68
71
73
75
76 void updateHandtracking();
77
78 static void processSpatialEvents(const QQuick3DViewport &vrViewport, const QJsonObject &events);
79
80private:
81 QQuick3DXrInputManager *q_ptr = nullptr;
82 QQuick3DXrHandInput *m_handInputState[2] {};
83
84 QSet<QQuick3DXrController *> m_controllers;
85 bool m_poseInUse[2][2] = {};
86 bool m_poseUsageDirty = true;
87
88 ar_hand_tracking_provider_t m_handTrackingProvider;
89 ar_hand_anchor_t m_handAnchors[2] {};
90
91 bool m_isHandTrackingSupported = false;
92 bool m_initialized = false;
93
94 struct JointCache {
95 QList<QVector3D> positions;
96 QList<QQuaternion> rotations;
97 } jcache[2];
98};
99
100QT_END_NAMESPACE
101
102#endif // QQUICK3DXINPUTMANAGER_VISIONOS_P_H
QtQuick3DXr::XrSpaceId getCurrentSpaceId() const
void updateAnchor(QQuick3DXrSpatialAnchor *anchor)
void anchorRemoved(QUuid uuid)
const QList< QQuick3DXrSpatialAnchor * > & anchors() const
void addAnchor(QQuick3DXrSpatialAnchor *anchor)
bool getBoundingBox2D(QtQuick3DXr::XrSpaceId space, QVector2D &offset, QVector2D &extent)
void anchorUpdated(QQuick3DXrSpatialAnchor *anchor)
bool setupSpatialAnchor(QtQuick3DXr::XrSpaceId space, QQuick3DXrSpatialAnchor &anchor)
bool getBoundingBox3D(QtQuick3DXr::XrSpaceId space, QVector3D &offset, QVector3D &extent)
static void processSpatialEvents(const QQuick3DViewport &vrViewport, const QJsonObject &events)
bool isPoseInUse(Hand hand, HandPoseSpace poseSpace)
void prepareHandtracking(ar_data_providers_t dataProviders)
void setPosePositionAndRotation(Hand hand, HandPoseSpace poseSpace, const QVector3D &position, const QQuaternion &rotation)
QQuick3DXrHandInput * rightHandInput() const
static QQuick3DXrInputManagerPrivate * get(QQuick3DXrInputManager *inputManager)
QQuick3DXrInputManagerPrivate(QQuick3DXrInputManager &manager)
void setupHandModel(QQuick3DXrHandModel *model)
void registerController(QQuick3DXrController *controller)
QQuick3DXrHandInput * leftHandInput() const
void unregisterController(QQuick3DXrController *controller)
The QVector2D class represents a vector or vertex in 2D space.
Definition qvectornd.h:31
The QVector3D class represents a vector or vertex in 3D space.
Definition qvectornd.h:171
Combined button and popup list for selecting options.
static const AnchorClassificationMap & getAnchorClassificationName(ar_plane_classification_t classification, bool *identified=nullptr)
static const AnchorClassificationMap anchorClassificationMap[]
static constexpr size_t anchorClassificationStart
static void updateAnchorProperties(QQuick3DXrSpatialAnchor &anchor, ar_plane_anchor_t planeAnchor)
struct ar_data_providers_s * ar_data_providers_t
struct ar_plane_anchors_s * ar_plane_anchors_t
struct ar_plane_detection_provider_s * ar_plane_detection_provider_t
struct ar_hand_tracking_provider_s * ar_hand_tracking_provider_t
struct ar_hand_anchor_s * ar_hand_anchor_t
QQuick3DXrSpatialAnchor::Classification label