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.

AudioListener3D

繼承: Node3D < Node < Object

覆寫聽音位置。

說明

加入場景樹並透過 make_current() 啟用後,此節點將覆寫聽音位置,可用於從與 Camera3D 不同的位置聽取聲音。

屬性

DopplerTracking

doppler_tracking

0

方法

void

clear_current()

Transform3D

get_listener_transform() const

bool

is_current() const

void

make_current()


列舉

enum DopplerTracking: 🔗

DopplerTracking DOPPLER_TRACKING_DISABLED = 0

禁用多普勒效應模擬(預設)。

DopplerTracking DOPPLER_TRACKING_IDLE_STEP = 1

Simulate Doppler effect by tracking positions of objects that are changed in _process. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio's AudioStreamPlayer3D.pitch_scale).

DopplerTracking DOPPLER_TRACKING_PHYSICS_STEP = 2

Simulate Doppler effect by tracking positions of objects that are changed in _physics_process. Changes in the relative velocity of this listener compared to those objects affect how audio is perceived (changing the audio's AudioStreamPlayer3D.pitch_scale).


屬性說明

DopplerTracking doppler_tracking = 0 🔗

If not DOPPLER_TRACKING_DISABLED, this listener will simulate the Doppler effect for objects changed in particular _process methods.

Note: The Doppler effect will only be heard on AudioStreamPlayer3Ds if AudioStreamPlayer3D.doppler_tracking is not set to AudioStreamPlayer3D.DOPPLER_TRACKING_DISABLED.


方法說明

void clear_current() 🔗

停用此監聽器,改用目前相機的監聽器。


Transform3D get_listener_transform() const 🔗

返回監聽器的全域正交化 Transform3D


bool is_current() const 🔗

若監聽器透過 make_current() 設為目前則返回 true,否則返回 false

注意:場景樹中可同時標記多個 AudioListener3D 為「目前」,但僅最後設定者實際生效。


void make_current() 🔗

啟用此監聽器,並覆寫目前相機的監聽器。