Implement FlxSound.pan for stereo sounds

This commit is contained in:
Ralty
2025-11-02 15:46:42 +07:00
parent 4d73ec3477
commit 3a88e78cec
4 changed files with 93 additions and 22 deletions
+2 -6
View File
@@ -273,13 +273,9 @@ import lime.media.openal.AL;
if (__isValid)
{
#if lime
// TODO: implement SoundTransform.leftToRight, etc. with Native setAngles?
__source.gain = volume;
var position = __source.position;
position.x = pan;
position.z = -1 * Math.sqrt(1 - Math.pow(pan, 2));
__source.position = position;
__source.pan = pan;
return value;
#end
}