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.5707964


屬性說明

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.5707964 🔗

  • void set_wedge_angle(value: float)

  • float get_wedge_angle()

每個楔形的角度,用於標識模擬十字鍵的四個方向。