XrHapticFeedback QML Type
Controls haptic feedback for an XR controller. More...
Import Statement: | import QtQuick3D.Xr |
Since: | Qt 6.9 |
Inherits: | |
Status: | Technical Preview |
Properties
- condition : enumeration
- controller : enumeration
- hapticEffect : XrHapticEffect
- trigger : bool
Methods
Detailed Description
Haptic feedback typically involves applying a short vibration to a controller to provide a tactile experience when an event happens. This can give the illusion of touching a button, for example.
There are two ways of using XrHapticFeedback:
The following code makes the right-hand controller vibrate when the value of the someObject.hit
property changes from false
to true
:
XrHapticFeedback { controller: XrHapticFeedback.RightController condition: XrHapticFeedback.RisingEdge trigger: someObject.hit hapticEffect: XrSimpleHapticEffect { amplitude: 0.5 duration: 300 frequency: 3000 } }
Property Documentation
condition : enumeration |
The condition for triggering this haptic feedback.
This property specifies how the trigger property is interpreted
It can be one of:
controller : enumeration |
The Controller that this haptic feedback will apply to.
It can be one of:
Constant | Value |
---|---|
XrHapticFeedback.LeftController | |
XrHapticFeedback.RightController | |
XrHapticFeedback.Unknown |
hapticEffect : XrHapticEffect |
This property describes the effect that is applied to the controller when the haptic feedback is triggered.
trigger : bool |
Method Documentation
void start() |
Starts the haptic feedback effect
void stop() |
Stops the haptic feedback effect
© 2024 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.