M3TerrainLodConfig class
============================================================ M3TerrainLodConfig — LOD distance thresholds / segment count table / hysteresis settings
Distance progression: 64, 128, 256, 512 (m) — geometric x2 Segment progression: 32, 16, 8, 4 — matches tile 32x32 segments, minimum 4x4
Both lists must have the same length (lodCount). Index 0 = highest detail (closest).
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
-
distances
→ List<
double> -
Trigger distance (meters) for each LOD level, index 0 = highest detail.
Generated from baseDistance with a geometric x2 progression:
distances[i] = baseDistance * 2^idistance < distances[0]-> LOD 0 (baseSegmentCount segments)distances[0] <= distance < distances[1]-> LOD 1 (baseSegmentCount/2 segments) ...final -
distancesSquared
→ List<
double> -
Squared distance thresholds (cached so we never redo the multiplication).
All comparisons use distanceSquared — never take a sqrt on tile coordinates.
final
-
segmentCounts
→ List<
int> -
Segment count per tile for each LOD level (32, 16, 8, 4).
Generated from baseSegmentCount with a geometric /2 progression:
segmentCounts[i] = baseSegmentCount >> ifinal
Static Methods
-
segmentCountForLod(
int lod) → int
Constants
- baseDistance → const double
- Base distance (meters) for LOD 0 — the highest-detail level. The full threshold list is generated from this value using a geometric x2 progression: base, base2, base4, base*8, ...
- baseSegmentCount → const int
- Segment count per tile for LOD 0 — the highest-detail level.
- hysteresisRatio → const double
- Hysteresis buffer ratio (±10% of the threshold value). The buffer width scales automatically with distance (the 320m band is wider than the 20m band), which matches the intuition that farther tiles are less sensitive to LOD switching — no extra constant table needed.
- lodCount → const int
- Number of LOD levels (LOD0: 32x32, LOD1: 16x16, LOD2: 8x8, LOD3: 4x4).