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.

XRNode3D

繼承: Node3D < Node < Object

被繼承: XRAnchor3D, XRController3D

A 3D node that has its position automatically updated by the XRServer.

說明

This node can be bound to a specific pose of an XRPositionalTracker and will automatically have its Node3D.transform updated by the XRServer. Nodes of this type must be added as children of the XROrigin3D node.

教學

屬性

PhysicsInterpolationMode

physics_interpolation_mode

2 (overrides Node)

StringName

pose

&"default"

bool

show_when_tracked

false

StringName

tracker

&""

方法

bool

get_has_tracking_data() const

bool

get_is_active() const

XRPose

get_pose()

void

trigger_haptic_pulse(action_name: String, frequency: float, amplitude: float, duration_sec: float, delay_sec: float)


訊號

tracking_changed(tracking: bool) 🔗

tracker開始或停止接收正在追蹤的pose的更新追蹤資料時發出。tracking參數指示追蹤器是否正在取得更新的追蹤資料。


屬性說明

StringName pose = &"default" 🔗

我們綁定到的姿勢的名稱。設計時並不知道追蹤器支援哪些姿勢。

Godot 定義了許多標準姿勢名稱,例如 aimgrip,但也可以在給定的 XRInterface 中配置其他名稱。


bool show_when_tracked = false 🔗

  • void set_show_when_tracked(value: bool)

  • bool get_show_when_tracked()

Enables showing the node when tracking starts, and hiding the node when tracking is lost.


StringName tracker = &"" 🔗

我們綁定到的追蹤器的名稱。設計時並不知道有哪些追蹤器可用。

Godot 定義了許多標準追蹤器,例如 left_handright_hand,但也可以在給定的 XRInterface 中配置其他追蹤器。


方法說明

bool get_has_tracking_data() const 🔗

如果 tracker 中有被追蹤 pose 的目前追蹤資料,則返回 true


bool get_is_active() const 🔗

如果 tracker 已註冊,並且 pose 正在被追蹤,則返回 true


XRPose get_pose() 🔗

返回包含被追蹤姿勢的目前狀態的 XRPose。這可以存取此姿勢的其他屬性。


void trigger_haptic_pulse(action_name: String, frequency: float, amplitude: float, duration_sec: float, delay_sec: float) 🔗

Triggers a haptic pulse on a device associated with this interface.

action_name is the name of the action for this pulse.

frequency is the frequency of the pulse, set to 0.0 to have the system use a default frequency.

amplitude is the amplitude of the pulse between 0.0 and 1.0.

duration_sec is the duration of the pulse in seconds.

delay_sec is a delay in seconds before the pulse is given.