Skip to content

feat(audio): implement dynamic 3D positional audio and distance attenuation for all sounds - #278

Draft
CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat-audio-3d-positional
Draft

feat(audio): implement dynamic 3D positional audio and distance attenuation for all sounds#278
CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:feat-audio-3d-positional

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

Implements realistic 3D positional audio and distance attenuation for all ModelExtras sound effects (engine startup/shutdown, indicator relay ticks, air brake hisses, reverse beepers, and switch clicks).

Changes

  • Calculate 3D distance attenuation relative to active camera position.
  • Support directional sound playback for non-player traffic/ambient vehicles.

@CanerKaraca23
CanerKaraca23 force-pushed the feat-audio-3d-positional branch from d1a84c6 to 73a6a6a Compare August 29, 2026 23:53
…uation for all sounds

# Conflicts:
#	src/utils/audiomgr.h
@CanerKaraca23
CanerKaraca23 force-pushed the feat-audio-3d-positional branch from 73a6a6a to aa6819a Compare August 30, 2026 01:07
@user-grinch

Copy link
Copy Markdown
Owner

LGTM. Is this tested on both CLEO4 & CLEO5? Last time I checked 4 & 5 behaved slightly differently from one another.

CVector playerPos = pPlayer->GetPosition();

for (CVehicle *pVeh : CPools::ms_pVehiclePool) {
if (CVector::Distance(pVeh->GetPosition(), TheCamera.GetPosition()) > 50.0f ) {

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may cause issue when camera detaches from player. Would cause sounds to play in MapEditors for example.

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@CanerKaraca23
CanerKaraca23 marked this pull request as draft August 30, 2026 02:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants