From 91df6ec83e3e613391ed91fc59f64db436583ed4 Mon Sep 17 00:00:00 2001 From: Garrett Johnson Date: Tue, 2 Jan 2024 02:00:32 +0900 Subject: [PATCH] Small fixes, demo update, fix to FadeRenderer --- example/googleMapsExample.js | 8 +++++--- example/src/FadeTilesRenderer.js | 2 +- example/src/controls/GlobeControls.js | 6 ++++++ example/src/controls/TileControls.js | 2 +- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/example/googleMapsExample.js b/example/googleMapsExample.js index 8a56b264e..5d7408847 100644 --- a/example/googleMapsExample.js +++ b/example/googleMapsExample.js @@ -194,10 +194,12 @@ function updateHtml() { // render html text updates const cacheFullness = tiles.lruCache.itemList.length / tiles.lruCache.maxSize; - let str = `Downloading: ${ tiles.stats.downloading } Parsing: ${ tiles.stats.parsing } Visible: ${ tiles.visibleTiles.size }`; + let str = ''; if ( params.enableCacheDisplay ) { + str += `Downloading: ${ tiles.stats.downloading } Parsing: ${ tiles.stats.parsing } Visible: ${ tiles.visibleTiles.size }
`; + const geomSet = new Set(); tiles.traverse( tile => { @@ -224,7 +226,7 @@ function updateHtml() { count += estimateBytesUsed( g ); } ); - str += `
Cache: ${ ( 100 * cacheFullness ).toFixed( 2 ) }% ~${ ( count / 1000 / 1000 ).toFixed( 2 ) }mb`; + str += `Cache: ${ ( 100 * cacheFullness ).toFixed( 2 ) }% ~${ ( count / 1000 / 1000 ).toFixed( 2 ) }mb
`; } @@ -232,7 +234,7 @@ function updateHtml() { const memory = renderer.info.memory; const programCount = renderer.info.programs.length; - str += `
Geometries: ${ memory.geometries } Textures: ${ memory.textures } Programs: ${ programCount }`; + str += `Geometries: ${ memory.geometries } Textures: ${ memory.textures } Programs: ${ programCount }`; } diff --git a/example/src/FadeTilesRenderer.js b/example/src/FadeTilesRenderer.js index 0cd8ace9f..0ba4961d4 100644 --- a/example/src/FadeTilesRenderer.js +++ b/example/src/FadeTilesRenderer.js @@ -30,7 +30,7 @@ function onTileVisibilityChange( scene, tile, visible ) { } - if ( ! isRootTile || ! this.fadeRootTiles || this.initialLayerRendered ) { + if ( ! isRootTile || this.fadeRootTiles || this.initialLayerRendered ) { this._fadeManager.fadeIn( scene ); diff --git a/example/src/controls/GlobeControls.js b/example/src/controls/GlobeControls.js index 0197ac23c..4adf4d617 100644 --- a/example/src/controls/GlobeControls.js +++ b/example/src/controls/GlobeControls.js @@ -76,6 +76,7 @@ export class GlobeControls extends TileControls { const { camera, scene, + pivotMesh, } = this; // clamp the camera distance @@ -94,6 +95,11 @@ export class GlobeControls extends TileControls { // when adjusting the up frame while moving hte camera if ( distanceToCenter > GLOBE_TRANSITION_THRESHOLD ) { + if ( this._dragMode !== 1 && this._rotationMode !== 1 ) { + + pivotMesh.visible = false; + + } this.reorientOnDrag = false; this.reorientOnZoom = true; diff --git a/example/src/controls/TileControls.js b/example/src/controls/TileControls.js index 7560ef2f5..28b7cbc5e 100644 --- a/example/src/controls/TileControls.js +++ b/example/src/controls/TileControls.js @@ -717,7 +717,7 @@ export class TileControls { // clamp the rotation to be within the provided limits // clamp to 0 here, as well, so we don't "pop" to the the value range - const angle = _localUp.angleTo( _forward ); + const angle = up.angleTo( _forward ); if ( altitude > 0 ) { altitude = Math.min( angle - minAltitude - 1e-2, altitude );