XRPose
继承: RefCounted
< Object
This object contains all data related to a pose on a tracked object.
描述
XR runtimes often identify multiple locations on devices such as controllers that are spatially tracked.
Orientation, location, linear velocity and angular velocity are all provided for each pose by the XR runtime. This object contains this state of a pose.
属性
Vector3 | angular_velocity |
bool | has_tracking_data |
Vector3 | linear_velocity |
StringName | name |
TrackingConfidence | tracking_confidence |
Transform3D | transform |
方法
Transform3D | get_adjusted_transform ( ) const1 |
枚举
enum TrackingConfidence:
TrackingConfidence XR_TRACKING_CONFIDENCE_NONE = 0
No tracking information is available for this pose.
TrackingConfidence XR_TRACKING_CONFIDENCE_LOW = 1
Tracking information may be inaccurate or estimated. For example, with inside out tracking this would indicate a controller may be (partially) obscured.
TrackingConfidence XR_TRACKING_CONFIDENCE_HIGH = 2
Tracking information is considered accurate and up to date.
属性说明
Vector3
angular_velocity = Vector3(0, 0, 0)
The angular velocity for this pose.
bool
has_tracking_data = false
If true
our tracking data is up to date. If false
we're no longer receiving new tracking data and our state is whatever that last valid state was.
Vector3
linear_velocity = Vector3(0, 0, 0)
The linear velocity of this pose.
StringName
name = &""
void
set_name ( value:StringName
)StringName
get_name ( )
The name of this pose. Usually, this name is derived from an action map set up by the user. Godot also suggests some pose names that XRInterface
objects are expected to implement:
-
root
is the root location, often used for tracked objects that do not have further nodes. -
aim
is the tip of a controller with its orientation pointing outwards, often used for raycasts. -
grip
is the location where the user grips the controller. -
skeleton
is the root location for a hand mesh, when using hand tracking and an animated skeleton is supplied by the XR runtime.
TrackingConfidence tracking_confidence = 0
void
set_tracking_confidence ( value: TrackingConfidence )- TrackingConfidence get_tracking_confidence ( )
The tracking confidence for this pose, provides insight on how accurate the spatial positioning of this record is.
Transform3D
transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0)
void
set_transform ( value:Transform3D
)Transform3D
get_transform ( )
The transform containing the original and transform as reported by the XR runtime.
方法说明
Transform3D
get_adjusted_transform ( ) const1
Returns the transform
with world scale and our reference frame applied. This is the transform used to position XRNode3D
objects.
本方法通常需要用户覆盖才能生效。
本方法无副作用,不会修改该实例的任何成员变量。
本方法除了能接受在此处描述的参数外,还能够继续接受任意数量的参数。
本方法用于构造某个类型。
调用本方法无需实例,可直接使用类名进行调用。
本方法描述的是使用本类型作为左操作数的有效运算符。
这个值是由下列位标志构成位掩码的整数。
无返回值。