OpenXRAction
继承: Resource
< RefCounted
< Object
An OpenXR action.
描述
This resource defines an OpenXR action. Actions can be used both for inputs (buttons, joysticks, triggers, etc.) and outputs (haptics).
OpenXR performs automatic conversion between action type and input type whenever possible. An analog trigger bound to a boolean action will thus return false
if the trigger is depressed and true
if pressed fully.
Actions are not directly bound to specific devices, instead OpenXR recognizes a limited number of top level paths that identify devices by usage. We can restrict which devices an action can be bound to by these top level paths. For instance an action that should only be used for hand held controllers can have the top level paths "/user/hand/left" and "/user/hand/right" associated with them. See the reserved path section in the OpenXR specification for more info on the top level paths.
Note that the name of the resource is used to register the action with.
属性
枚举
enum ActionType:
ActionType OPENXR_ACTION_BOOL = 0
This action provides a boolean value.
ActionType OPENXR_ACTION_FLOAT = 1
This action provides a float value between 0.0
and 1.0
for any analog input such as triggers.
ActionType OPENXR_ACTION_VECTOR2 = 2
This action provides a Vector2
value and can be bound to embedded trackpads and joysticks.
ActionType OPENXR_ACTION_POSE = 3
该枚举目前没有描述,请帮我们\ :ref:贡献一个 <doc_updating_the_class_reference>
\ 吧!
属性说明
ActionType action_type = 1
void
set_action_type ( value: ActionType )- ActionType get_action_type ( )
The type of action.
String
localized_name = ""
The localized description of this action.
PackedStringArray
toplevel_paths = PackedStringArray()
void
set_toplevel_paths ( value:PackedStringArray
)PackedStringArray
get_toplevel_paths ( )
A collections of toplevel paths to which this action can be bound.
Note: The returned array is copied and any changes to it will not update the original property value. See PackedStringArray
for more details.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。