@@ -184,11 +184,15 @@ public SharedStaticShapeInstance(Viewer viewer, string path, List<StaticShape> s
184184 // Object radius should extend from central location to the furthest instance location PLUS the actual object radius.
185185 ObjectRadius = shapes . Max ( s => ( Location . Location - s . Location . Location ) . Length ( ) ) + dlHighest . ViewSphereRadius ;
186186
187- // Set to MaxValue so that an object never disappears.
188- // Many MSTS objects had a LOD of 2km which is the maximum distance that MSTS can handle.
189- // Open Rails can handle greater distances, so we override the lowest-detail LOD to make sure OR shows shapes further away than 2km.
190- // See http://www.elvastower.com/forums/index.php?/topic/35301-menu-options/page__view__findpost__p__275531
191- ObjectViewingDistance = float . MaxValue ;
187+ // Object viewing distance is easy because it's based on the outside of the object radius.
188+ if ( viewer . Settings . LODViewingExtension )
189+ // Set to MaxValue so that an object never disappears.
190+ // Many MSTS objects had a LOD of 2km which is the maximum distance that MSTS can handle.
191+ // Open Rails can handle greater distances, so we override the lowest-detail LOD to make sure OR shows shapes further away than 2km.
192+ // See http://www.elvastower.com/forums/index.php?/topic/35301-menu-options/page__view__findpost__p__275531
193+ ObjectViewingDistance = float . MaxValue ;
194+ else
195+ ObjectViewingDistance = dlLowest . ViewingDistance ;
192196 }
193197
194198 // Create all the primitives for the shared shape.
@@ -2522,12 +2526,12 @@ public void PrepareFrame(RenderFrame frame, WorldPosition location, Matrix[] ani
25222526 ? lodControl . DistanceLevels [ lodControl . DistanceLevels . Length - 1 ]
25232527 : displayDetail ;
25242528
2525- // Extend the lowest LOD to the maximum viewing distance.
2526- // Set to MaxValue so that an object never disappears.
2527- // Many MSTS objects had a LOD of 2km which is the maximum distance that MSTS can handle .
2528- // Open Rails can handle greater distances, so we override the lowest-detail LOD to make sure OR shows shapes further away than 2km .
2529- // See http://www.elvastower.com/forums/index.php?/topic/35301-menu-options/page__view__findpost__p__275531
2530- if ( displayDetailLevel == lodControl . DistanceLevels . Length - 1 )
2529+ // If set, extend the lowest LOD to the maximum viewing distance.
2530+ if ( Viewer . Settings . LODViewingExtension && displayDetailLevel == lodControl . DistanceLevels . Length - 1 )
2531+ // Set to MaxValue so that an object never disappears .
2532+ // Many MSTS objects had a LOD of 2km which is the maximum distance that MSTS can handle .
2533+ // Open Rails can handle greater distances, so we override the lowest-detail LOD to make sure OR shows shapes further away than 2km.
2534+ // See http://www.elvastower.com/forums/index.php?/topic/35301-menu-options/page__view__findpost__p__275531
25312535 distanceDetail . ViewingDistance = float . MaxValue ;
25322536
25332537 for ( var i = 0 ; i < displayDetail . SubObjects . Length ; i ++ )
0 commit comments