File tree Expand file tree Collapse file tree 1 file changed +4
-2
lines changed
Source/RunActivity/Viewer3D Expand file tree Collapse file tree 1 file changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -494,15 +494,17 @@ public class SoundSource : SoundSourceBase
494494 {
495495 /// <summary>
496496 /// Squared cutoff distance. No sound is audible above that, except for the actual player train,
497- /// where cutoff occurs at a distance wich is higher than the train length
497+ /// where cutoff occurs at a distance wich is higher than the train length plus offset to
498+ /// approximately take into account distance from camera to car
498499 /// </summary>
499500 private int CutOffDistanceM2
500501 {
501502 get
502503 {
503504 const int staticDistanceM2 = 4000000 ;
504505 var isPlayer = Car ? . Train ? . IsActualPlayerTrain ?? false ;
505- return ( int ) Math . Max ( staticDistanceM2 , isPlayer ? Car . Train . Length * Car . Train . Length : 0 ) ;
506+ var correctedLength = isPlayer ? Car . Train . Length + 50 : 0 ;
507+ return ( int ) Math . Max ( staticDistanceM2 , correctedLength * correctedLength ) ;
506508 }
507509 }
508510 /// <summary>
You can’t perform that action at this time.
0 commit comments