scp-fs2open / scp-fs2open/fs2open.github.com

snd_play_3d in sound.cpp not interpolating correctly

Open
#4,753 1 comment 0 reactions 0 assignees View on GitHub
bug sound
Dominant language
C++
Stars
487
Forks
184
Avg merge
3d 9h
Merged PRs (30d)
44

Description

`sound_handle snd_play_3d(game_snd* gs, vec3d* source_pos, vec3d* listen_pos, float radius, vec3d* source_vel,
int looping, float vol_scale, int priority, vec3d* /*sound_fvec*/, float range_factor,
int force, bool /*is_ambient*/)`

is using:

`
if ( distance <= min_range ) {
volume = max_volume;
}
else {
volume = max_volume - max_volume*(distance/max_range);
}
`

as part of its volume calculation,
which is almost guaranteed(unless I am missing something) to cause a jump in volume if distance is slightly greater than min_range in most cases(e.g. min_range > 0 and distance = min_range vs distance = min_range + some_epsilon)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.