Have the listener follow a camera or a renderable, every frame.
Pass app.viewport and world-placed sounds pan and fade around the view
with nothing else to write. Pass the player and they are heard from the
character rather than the camera, which is usually what a scrolling game
with a lagging camera wants. Pass null to stop, leaving the listener
where it was.
A Camera3d also contributes its ORIENTATION, so turning the camera
swings the stereo image. Anything else contributes position only.
Following stops on its own if the target is destroyed, which a stage that
owns its camera does on every state change.
Have the listener follow a camera or a renderable, every frame.
Pass
app.viewportand world-placed sounds pan and fade around the view with nothing else to write. Pass the player and they are heard from the character rather than the camera, which is usually what a scrolling game with a lagging camera wants. Passnullto stop, leaving the listener where it was.A Camera3d also contributes its ORIENTATION, so turning the camera swings the stereo image. Anything else contributes position only.
Following stops on its own if the target is destroyed, which a stage that owns its camera does on every state change.