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.
Checking the stable version of the documentation...
OpenXRAction
繼承: Resource < RefCounted < Object
OpenXR 動作。
說明
該資源定義了一個 OpenXR 動作。動作可用於輸入(按鈕、操縱桿、觸發器等)和輸出(觸覺)。
只要有可能,OpenXR 就會在動作型別和輸入型別之間執行自動轉換。因此,如果觸發器被按下,則綁定到一個布林動作的模擬觸發器將回傳 false,如果完全按下則回傳 true。
動作並不被直接綁定到特定裝置,相反,OpenXR 識別了有限數量的頂級路徑,這些路徑按用途識別裝置。我們可以通過這些頂級路徑來限制一個動作可以被綁定到哪些裝置上。例如,一個只套用至手持控制器的動作,可以具有與其關聯的頂級路徑“/user/hand/left”和“/user/hand/right”。有關頂級路徑的詳細資訊,請參閱 OpenXR 規範中的保留路徑部分。
注意,資源的名字是用來注冊動作的。
屬性
|
||
|
||
|
列舉
enum ActionType: 🔗
ActionType OPENXR_ACTION_BOOL = 0
該動作提供布林值。
ActionType OPENXR_ACTION_FLOAT = 1
該動作提供 0.0 和 1.0 之間的浮點值,用於扳機等模擬輸入。
ActionType OPENXR_ACTION_VECTOR2 = 2
該動作提供 Vector2 值,可以和嵌入式控制板與操縱桿綁定。
ActionType OPENXR_ACTION_POSE = 3
There is currently no description for this enum. Please help us by contributing one!
屬性說明
ActionType action_type = 1 🔗
void set_action_type(value: ActionType)
ActionType get_action_type()
動作的型別。
該動作的當地語系化描述。
PackedStringArray toplevel_paths = PackedStringArray() 🔗
void set_toplevel_paths(value: PackedStringArray)
PackedStringArray get_toplevel_paths()
該動作所能綁定到的頂級路徑的合集。
Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray for more details.