6#if defined(Q_NO_TEMPORARY_DISABLE_XR_API)
49 return m_posePosition;
54 return m_poseRotation;
59 return m_jointPositions;
64 m_jointPositions = newJointPositions;
66 m_jointRotations = newJointRotations;
69#if defined(Q_NO_TEMPORARY_DISABLE_XR_API)
76 return m_jointRotations;
81 return m_pokePosition;
86 if (m_pokePosition == newPokePosition)
88 m_pokePosition = newPokePosition;
92#if defined(Q_NO_TEMPORARY_DISABLE_XR_API)
111void QOpenXrHandModel::updatePose()
115 int count = jointListProp.count(&jointListProp);
119 auto *joint = jointListProp.
at(&jointListProp,
i);
121 joint->setRotation(rotations.at(
i));
125void QOpenXrHandModel::setupModel()
127 if (!m_handTracker) {
131 qWarning() <<
"XrHandModel does not support changing hand tracker";
134#if defined(Q_NO_TEMPORARY_DISABLE_XR_API)
139 const auto &handGeometryData = inputMan->m_handGeometryData[hand];
140 const auto &handMeshData = inputMan->m_handMeshData[hand];
142 Q_ASSERT(handGeometryData.geometry);
153 for (
int i = 0;
i < XR_HAND_JOINT_COUNT_EXT; ++
i) {
154 const auto &pose = handMeshData.jointBindPoses[
i];
159 joint->setPosition(
pos);
160 joint->setRotation(rot);
161 jointListProp.append(&jointListProp, joint);
171 m_initialized =
true;
183 return m_handTracker;
188 if (m_handTracker == newHandTracker)
190 m_handTracker = newHandTracker;
const_reference at(qsizetype i) const noexcept
void reserve(qsizetype size)
void append(parameter_type t)
The QMatrix4x4 class represents a 4x4 transformation matrix in 3D space.
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.
virtual void componentComplete()=0
Invoked after the root component that caused this instantiation has completed construction.
The QQuaternion class represents a quaternion consisting of a vector and scalar.
QQuick3DSkin * skin
\qmlproperty Skin Model::skin
void setGeometry(QQuick3DGeometry *geometry)
QList< QMatrix4x4 > inverseBindPoses
void setVisible(bool visible)
QQuick3DNode(QQuick3DNode *parent=nullptr)
\qmltype Node \inherits Object3D \inqmlmodule QtQuick3D
void setInverseBindPoses(const QList< QMatrix4x4 > &poses)
QQmlListProperty< QQuick3DNode > joints
\qmlproperty List<QtQuick3D::Node> Skin::joints
The QVector3D class represents a vector or vertex in 3D space.
QQuaternion toQQuaternion(const XrQuaternionf &q)
QVector3D toQVector(const XrVector3f &v)
Combined button and popup list for selecting options.
static const QCssKnownValue positions[NumKnownPositionModes - 1]
GLenum GLenum GLsizei count
GLuint GLenum GLenum transform
static qreal position(const QQuickItem *item, QQuickAnchors::Anchor anchorLine)
connect(quitButton, &QPushButton::clicked, &app, &QCoreApplication::quit, Qt::QueuedConnection)