Skip to content

Commit

Permalink
Use globe.terrainExaggeration if scene.verticalExaggeration is not set
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeshurun Hembd committed Dec 1, 2023
1 parent 6953452 commit c4dfc59
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions packages/engine/Source/Scene/Scene.js
Original file line number Diff line number Diff line change
Expand Up @@ -1900,10 +1900,17 @@ Scene.prototype.updateFrameState = function () {

frameState.verticalExaggeration = this.verticalExaggeration;
frameState.verticalExaggerationRelativeHeight = this.verticalExaggerationRelativeHeight;
if (defined(this.globe && this.verticalExaggeration !== 1.0)) {
// Update terrain exaggeration to match the rest of the scene
this.globe.terrainExaggeration = this.verticalExaggeration;
this.globe.terrainExaggerationRelativeHeight = this.verticalExaggerationRelativeHeight;
if (defined(this.globe)) {
if (this.verticalExaggeration !== 1.0) {
// Update terrain exaggeration to match the rest of the scene
this.globe.terrainExaggeration = this.verticalExaggeration;
this.globe.terrainExaggerationRelativeHeight = this.verticalExaggerationRelativeHeight;
} else {
// The new .verticalExaggeration was not set.
// Use the old globe.terrainExaggeration
frameState.verticalExaggeration = this.globe.terrainExaggeration;
frameState.verticalExaggerationRelativeHeight = this.globe.terrainExaggerationRelativeHeight;
}
}

if (
Expand Down

0 comments on commit c4dfc59

Please sign in to comment.