-
-
Notifications
You must be signed in to change notification settings - Fork 21.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Expose Viewport methods to get current 2D/3D audio listener #97159
Expose Viewport methods to get current 2D/3D audio listener #97159
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see no reason not to, to be honest.
7f6d54e
to
73be914
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needs a squash but otherwise looks good to me.
…er_3d to scripting Document exposed methods Apply suggestions from code review Co-authored-by: Micky <66727710+Mickeon@users.noreply.github.com> Document default behavior when no audio listeners are active
73be914
to
bdcee83
Compare
Thanks! |
<method name="get_audio_listener_2d" qualifiers="const"> | ||
<return type="AudioListener2D" /> | ||
<description> | ||
Returns the currently active 2D audio listener. Returns [code]null[/code] if there are no active 2D audio listeners, in which case the active 2D camera will be treated as listener. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2D uses viewport transform for positional audio. Unlike 3D, you can hear sounds without any Camera2D in the scene.
Sorry for late review .-.
This exposes the already existing Viewport::get_current_audio_listener_2d and Viewport::get_current_audio_listener_3d methods to scripting, in the same way that get_camera_2d and get_camera_3d are already exposed.
closes #54612