From 3fae851833aae0bb2972d2b35612fc10b737e4c1 Mon Sep 17 00:00:00 2001 From: Darren Ranalli Date: Mon, 21 Jul 2003 20:33:42 +0000 Subject: [PATCH] inverse-square-of-distance volume attenuation --- direct/src/showbase/SfxPlayer.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/direct/src/showbase/SfxPlayer.py b/direct/src/showbase/SfxPlayer.py index b54f126b82..595b0a466e 100644 --- a/direct/src/showbase/SfxPlayer.py +++ b/direct/src/showbase/SfxPlayer.py @@ -6,7 +6,7 @@ class SfxPlayer: Play sound effects, potentially localized. """ - UseInverseSquare = 0 + UseInverseSquare = 1 def __init__(self): # Distance at which sounds can no longer be heard @@ -14,7 +14,8 @@ class SfxPlayer: self.cutoffDistance = 120.0 # cutoff for inverse square attenuation - #self.cutoffDistance = 300.0 + if SfxPlayer.UseInverseSquare: + self.cutoffDistance = 300.0 # volume attenuates according to the inverse square of the # distance from the source. volume = 1/(distance^2) # this is the volume at which a sound is nearly inaudible