XrHapticFeedback QML Type
Gestisce il feedback tattile per un controller XR. Altro...
| Import Statement: | import QtQuick3D.Xr |
| Since: | Qt 6.9 |
| Inherits: | |
| Status: | Technology preview |
Questo tipo è in anteprima tecnologica ed è soggetto a modifiche.
Proprietà
- condition : enumeration
- controller : enumeration
- hapticEffect : XrHapticEffect
- trigger : bool
Metodi
Descrizione dettagliata
Il feedback tattile consiste solitamente nell'applicare una breve vibrazione a un controller per fornire un'esperienza tattile quando si verifica un evento. Ciò può dare l'illusione di premere un pulsante, ad esempio.
Esistono due modi per utilizzare XrHapticFeedback:
- In modo imperativo, chiamando la funzione ` start `
- In modo dichiarativo, specificando trigger e condition
Il codice seguente fa vibrare il controller destro quando il valore della proprietà ` someObject.hit ` passa da ` false ` a ` true`:
XrHapticFeedback {
controller: XrHapticFeedback.RightController
condition: XrHapticFeedback.RisingEdge
trigger: someObject.hit
hapticEffect: XrSimpleHapticEffect {
amplitude: 0.5
duration: 300
frequency: 3000
}
}Documentazione delle proprietà
condition : enumeration [default: XrHapticFeedback.RisingEdge]
La condizione che determina l'attivazione di questo feedback tattile.
Questa proprietà specifica come viene interpretata la proprietà ` trigger `
Può assumere uno dei seguenti valori:
| Costante | Descrizione |
|---|---|
XrHapticFeedback.RisingEdge | L’effetto tattile ha inizio quando la proprietà ` trigger ` passa da ` false ` a ` true`. |
XrHapticFeedback.TrailingEdge | L'effetto tattile ha inizio quando trigger passa da true a false. |
controller : enumeration
Il controller a cui verrà applicato questo feedback tattile.
Può essere uno dei seguenti:
| Costante | Valore |
|---|---|
XrHapticFeedback.LeftController | |
XrHapticFeedback.RightController | |
XrHapticFeedback.UnknownController |
hapticEffect : XrHapticEffect
Questa proprietà descrive l'effetto applicato al controller quando viene attivato il feedback tattile.
trigger : bool
Trigger per il feedback tattile
Questa proprietà definisce a cosa reagirà l'effetto tattile. La proprietà condition determina come viene interpretato il trigger.
Documentazione sui metodi
void start()
Avvia l'effetto di feedback tattile.
void stop()
Disattiva l'effetto di feedback tattile.
© 2026 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.