mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 02:42:49 -04:00
inverse-square-of-distance volume attenuation
This commit is contained in:
parent
f9d51290c6
commit
3fae851833
@ -6,7 +6,7 @@ class SfxPlayer:
|
|||||||
Play sound effects, potentially localized.
|
Play sound effects, potentially localized.
|
||||||
"""
|
"""
|
||||||
|
|
||||||
UseInverseSquare = 0
|
UseInverseSquare = 1
|
||||||
|
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
# Distance at which sounds can no longer be heard
|
# Distance at which sounds can no longer be heard
|
||||||
@ -14,7 +14,8 @@ class SfxPlayer:
|
|||||||
self.cutoffDistance = 120.0
|
self.cutoffDistance = 120.0
|
||||||
|
|
||||||
# cutoff for inverse square attenuation
|
# 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
|
# volume attenuates according to the inverse square of the
|
||||||
# distance from the source. volume = 1/(distance^2)
|
# distance from the source. volume = 1/(distance^2)
|
||||||
# this is the volume at which a sound is nearly inaudible
|
# this is the volume at which a sound is nearly inaudible
|
||||||
|
Loading…
x
Reference in New Issue
Block a user