XrHapticFeedback QML Type
XR コントローラの触覚フィードバックを制御する。詳細...
| Import Statement: | import QtQuick3D.Xr |
| Since: | Qt 6.9 |
| Inherits: |
プロパティ
- condition : enumeration
- controller : enumeration
- hapticEffect : XrHapticEffect
- trigger : bool
方法
詳細説明
触覚フィードバックは通常、コントローラに短い振動を加えることで、イベントが発生したときに触覚体験を提供します。これにより、例えばボタンに触れたような錯覚を与えることができます。
XrHapticFeedbackを使用するには2つの方法があります:
次のコードは、someObject.hit プロパティの値がfalse からtrue に変化したときに、右側のコントローラを振動させます:
XrHapticFeedback { controller: XrHapticFeedback.RightController condition: XrHapticFeedback.RisingEdge trigger: someObject.hit hapticEffect: XrSimpleHapticEffect { amplitude: 0.5 duration: 300 frequency: 3000 } }
プロパティのドキュメント
condition : enumeration [default: XrHapticFeedback.RisingEdge]
この触覚フィードバックをトリガーするための条件。
このプロパティは、trigger プロパティがどのように解釈されるかを指定します。
以下のいずれかになります:
| 定数 | 説明 |
|---|---|
XrHapticFeedback.RisingEdge | ハプティック効果は、trigger がfalse からtrue に変化したときに開始する。 |
XrHapticFeedback.TrailingEdge | ハプティック効果は、trigger がtrue からfalse に変わるときに開始する。 |
controller : enumeration
この触覚フィードバックが適用されるコントローラ。
以下のいずれかになります:
| 定数 | 値 |
|---|---|
XrHapticFeedback.LeftController | |
XrHapticFeedback.RightController | |
XrHapticFeedback.UnknownController |
hapticEffect : XrHapticEffect
このプロパティは、触覚フィードバックがトリガーされたときにコントローラに適用される効果を記述する。
trigger : bool
触覚フィードバックのトリガー
このプロパティはハプティック効果が何に反応するかを定義します。condition プロパティは、トリガーがどのように解釈されるかを決定する。
メソッドのドキュメント
void start()
触覚フィードバック効果を開始する。
void stop()
触覚フィードバック効果を停止する。
© 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.