Skip to content

Commit

Permalink
Small fixes, demo update, fix to FadeRenderer
Browse files Browse the repository at this point in the history
  • Loading branch information
gkjohnson committed Jan 1, 2024
1 parent 9c24b8a commit 91df6ec
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
8 changes: 5 additions & 3 deletions example/googleMapsExample.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 }<br/>`;

const geomSet = new Set();
tiles.traverse( tile => {

Expand All @@ -224,15 +226,15 @@ function updateHtml() {
count += estimateBytesUsed( g );

} );
str += `<br/>Cache: ${ ( 100 * cacheFullness ).toFixed( 2 ) }% ~${ ( count / 1000 / 1000 ).toFixed( 2 ) }mb`;
str += `Cache: ${ ( 100 * cacheFullness ).toFixed( 2 ) }% ~${ ( count / 1000 / 1000 ).toFixed( 2 ) }mb<br/>`;

}

if ( params.enableRendererStats ) {

const memory = renderer.info.memory;
const programCount = renderer.info.programs.length;
str += `<br/>Geometries: ${ memory.geometries } Textures: ${ memory.textures } Programs: ${ programCount }`;
str += `Geometries: ${ memory.geometries } Textures: ${ memory.textures } Programs: ${ programCount }`;

}

Expand Down
2 changes: 1 addition & 1 deletion example/src/FadeTilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );

Expand Down
6 changes: 6 additions & 0 deletions example/src/controls/GlobeControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ export class GlobeControls extends TileControls {
const {
camera,
scene,
pivotMesh,
} = this;

// clamp the camera distance
Expand All @@ -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;

Expand Down
2 changes: 1 addition & 1 deletion example/src/controls/TileControls.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
Expand Down

0 comments on commit 91df6ec

Please sign in to comment.