XrHapticFeedback QML Type
控制 XR 控制器的触觉反馈。更多
Import Statement: | import QtQuick3D.Xr |
Since: | Qt 6.9 |
Inherits: | |
Status: | Technical Preview |
属性
- condition : enumeration
- controller : enumeration
- hapticEffect : XrHapticEffect
- trigger : bool
方法
详细说明
触觉反馈通常是在发生事件时,对控制器施加短时振动,以提供触觉体验。例如,这可以让人产生触摸按钮的错觉。
使用 XrHapticFeedback 有两种方法:
当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 |
controller : enumeration |
该触觉反馈适用的控制器。
可以是
常量 | 值 |
---|---|
XrHapticFeedback.LeftController | |
XrHapticFeedback.RightController | |
XrHapticFeedback.UnknownController |
hapticEffect : XrHapticEffect |
该属性描述触觉反馈触发时应用于控制器的效果。
方法文档
void start() |
启动触觉反馈效果
void stop() |
停止触觉反馈效果
© 2025 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.