# How to calculate the sound volume for the left ear and right ear based on the object position & velocity, player position & forward vector? (3D sound) [closed]

Minimum distance for 3D volume = 1.0;
Maximum distance for 3D volume = 100.0;

This is the declaration of the function:

An object can be a ball moving closer to the player.

void CalculateSoundVolume(Vec3 objectPosition,
Vec3 objectVelocity,