OpenXRDpadBindingModifier

继承: OpenXRIPBindingModifier < OpenXRBindingModifier < Resource < RefCounted < Object

十字键绑定修改器会将轴输入转换为十字键输出。

描述

方向键(DPad)绑定修饰器可将轴向输入转换为模拟方向键的输出。该修饰器会为每个方向键方位在交互配置文件中创建新的输入路径。当绑定到动作时,方向键模拟功能将被激活。 请勿 将方向键输入与普通输入混合用于同一控制器的同一动作集,否则在向OpenXR提交建议绑定时会返回错误。

详见 XR_EXT_dpad_binding 获取完整说明。

注意:若启用了方向键绑定修饰器扩展,所有方向键绑定路径都会出现在动作映射表中。在交互配置文件中添加此修饰器可进一步自定义行为。

属性


属性说明

OpenXRActionSet action_set 🔗

此方向键绑定修饰器生效的动作集。


float center_region = 0.1 🔗

  • void set_center_region(value: float)

  • float get_center_region()

方向键中心区域的判定范围,当输入位于该区域内时返回 true


String input_path = "" 🔗

  • void set_input_path(value: String)

  • String get_input_path()

此方向键绑定修饰器对应的输入路径。


bool is_sticky = false 🔗

  • void set_is_sticky(value: bool)

  • bool get_is_sticky()

当设为 false 时,摇杆进入新方向键区域时触发状态切换为 true。

当设为 true 时,只要摇杆保持在活动方向键区域内,即使与其他区域重叠也将持续保持 true 状态。


OpenXRHapticBase off_haptic 🔗

用户松开输入时发出的触觉脉冲。


OpenXRHapticBase on_haptic 🔗

用户按下输入时发出的触觉脉冲。


float threshold = 0.6 🔗

  • void set_threshold(value: float)

  • float get_threshold()

当输入值大于等于该阈值时,对应方向的方向键状态将切换为 true。该状态会持续保持,直到输入值低于 threshold_released 释放阈值。


float threshold_released = 0.4 🔗

  • void set_threshold_released(value: float)

  • float get_threshold_released()

输入值低于此值时,输出变为 false。


float wedge_angle = 1.5708 🔗

  • void set_wedge_angle(value: float)

  • float get_wedge_angle()

每个楔形的角度,用于标识模拟十字键的四个方向。