Skip to content

Commit

Permalink
fix(Terrain): fix terrain subdivision when a terrain tile only has va…
Browse files Browse the repository at this point in the history
…lues that should be clamped
  • Loading branch information
jailln committed Oct 10, 2024
1 parent c862ca7 commit cb96727
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/Parser/XbilParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,16 @@ export function computeMinMaxElevation(texture, pitch, options) {
}
}
}
if (options.zmin > min) { min = options.zmin; }
if (options.zmax < max) { max = options.zmax; }
// Clamp values to zmin and zmax values configured in ElevationLayer
if (options.zmin != null) {
if (min < options.zmin) { min = options.zmin; }
if (max < options.zmin) { max = options.zmin; }
}

if (options.zmax != null) {
if (min > options.zmax) { min = options.zmax; }
if (max > options.zmax) { max = options.zmax; }
}
}

if (max === -Infinity || min === Infinity) {
Expand Down

0 comments on commit cb96727

Please sign in to comment.