Attention: Here be dragons

This is the latest (unstable) version of this documentation, which may document features not available in or compatible with released stable versions of Godot.

OpenXRDpadBindingModifier

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

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

描述

十字键绑定修改器会将轴输入转换为十字键输出,模拟十字键。交互配置中会添加十字键每个方向对应的输入路径,与动作绑定后就会激活十字键模拟。不应该在同一个控件的同一动作集中将十字键输入与普通输入结合使用,这会导致在绑定提交给 OpenXR 时返回错误。

详见 XR_EXT_dpad_binding

注意:如果启用了十字键绑定修改器扩展,所有十字键绑定路径都将在动作映射中可用。将修改器添加到交互配置可以进一步自定义行为。

属性

OpenXRActionSet

action_set

float

center_region

0.1

String

input_path

""

bool

is_sticky

false

OpenXRHapticBase

off_haptic

OpenXRHapticBase

on_haptic

float

threshold

0.6

float

threshold_released

0.4

float

wedge_angle

1.5708


属性说明

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。它会保持为 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()

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