6#ifndef QQUICK3DXRCONTROLLER_H
7#define QQUICK3DXRCONTROLLER_H
20#include <QtQuick3DXr/qtquick3dxrglobal.h>
23#include <QtQuick3D/private/qquick3dnode_p.h>
24#include <QtQml/QQmlEngine>
34 Q_PROPERTY(Controller controller READ controller WRITE setController NOTIFY controllerChanged FINAL)
35 Q_PROPERTY(
bool isActive READ isActive NOTIFY isActiveChanged FINAL)
36 Q_PROPERTY(HandPoseSpace poseSpace READ poseSpace WRITE setPoseSpace NOTIFY poseSpaceChanged FINAL)
38 Q_PROPERTY(QVector3D pokePosition READ pokePosition NOTIFY pokePositionChanged FINAL)
39 Q_PROPERTY(QList<QVector3D> jointPositions READ jointPositions NOTIFY jointPositionsChanged FINAL)
40 Q_PROPERTY(QList<QQuaternion> jointRotations READ jointRotations NOTIFY jointRotationsChanged FINAL)
42 QML_NAMED_ELEMENT(XrController)
43 QML_ADDED_IN_VERSION(6, 8)
46 enum class Controller {
47 LeftController = uint(QtQuick3DXr::Controller::LeftController),
48 RightController = uint(QtQuick3DXr::Controller::RightController),
49 UnknownController = uint(QtQuick3DXr::Controller::UnknownController),
50 LeftHand = uint(QtQuick3DXr::Controller::LeftHand),
51 RightHand = uint(QtQuick3DXr::Controller::RightHand),
52 ControllerLeft = LeftController,
53 ControllerRight = RightController,
54 ControllerNone = UnknownController,
58 enum class HandPoseSpace {
59 GripPose = uint(QtQuick3DXr::HandPoseSpace::GripPose),
60 AimPose = uint(QtQuick3DXr::HandPoseSpace::AimPose),
64 QQuick3DXrController();
66 Controller controller()
const;
67 void setController(Controller newController);
69 QQuick3DXrHandInput *handInput()
const;
71 HandPoseSpace poseSpace()
const;
72 void setPoseSpace(HandPoseSpace newPoseSpace);
74 QVector3D pokePosition()
const;
76 QList<QVector3D> jointPositions()
const;
77 QList<QQuaternion> jointRotations()
const;
79 bool isActive()
const;
82 void controllerChanged();
83 void actionMapperChanged();
85 void poseSpaceChanged();
87 void pokePositionChanged();
89 void jointPositionsChanged();
90 void jointRotationsChanged();
91 void jointDataUpdated();
93 void isActiveChanged();
96 void setIsActive(
bool isActive);
98 QPointer<QQuick3DXrInputManager> m_inputManager;
99 Controller m_controller = Controller::UnknownController;
100 QMetaObject::Connection m_isActiveConnection;
101 HandPoseSpace m_poseSpace = HandPoseSpace::AimPose;
102 QVector3D m_pokePosition;
103 bool m_isActive =
false;
static void registerAction(QQuick3DXrInputAction *action)
static QList< QPointer< QQuick3DXrHapticFeedback > > getHapticEffects(QtQuick3DXr::Controller controller)
static void registerHapticEffect(QPointer< QQuick3DXrHapticFeedback >)
static void removeHapticEffect(QQuick3DXrHapticFeedback *action)
static void handleInput(QQuick3DXrInputAction::Action id, QtQuick3DXr::Controller controller, const char *shortName, float value)
static void removeAction(QQuick3DXrInputAction *action)
Hand hand() const
\qmlproperty enumeration XrHandModel::hand
void setHand(Hand newHand)
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void handTrackerChanged()
void classBegin() override
Invoked after class creation, but before any properties have been set.
void hapticEffectChanged()
void setCondition(enum Condition newCondition)
~QQuick3DXrHapticFeedback() override
void setController(Controller newController)
void setTrigger(bool newTrigger)
enum Condition condition() const
\qmlproperty enumeration QtQuick3D.Xr::XrHapticFeedback::condition
void stop()
\qmlmethod void XrHapticFeedback::stop()
void componentComplete() override
Invoked after the root component that caused this instantiation has completed construction.
void setHapticEffect(QQuick3DXrAbstractHapticEffect *newHapticEffect)
QQuick3DXrAbstractHapticEffect * hapticEffect() const
\qmlproperty XrHapticEffect XrHapticFeedback::hapticEffect
Controller controller() const
\qmlproperty enumeration QtQuick3D.Xr::XrHapticFeedback::controller
void setAmplitude(float newAmplitude)
void setFrequency(float newFrequency)
void setDuration(float newDuration)
Combined button and popup list for selecting options.
QtQuick3DXr::Handedness handednessForController(QtQuick3DXr::Controller controller)