Skip to content

Commit

Permalink
Make use of cached._loadIndex (#605)
Browse files Browse the repository at this point in the history
  • Loading branch information
Nmzik committed Jul 8, 2024
1 parent 202c221 commit c46d59c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
1 change: 0 additions & 1 deletion src/base/TilesRendererBase.js
Original file line number Diff line number Diff line change
Expand Up @@ -359,7 +359,6 @@ export class TilesRendererBase {

tile.__basePath = tileSetDir;

tile._loadIndex = 0;
tile.__lastFrameVisited = - 1;

}
Expand Down
12 changes: 6 additions & 6 deletions src/three/TilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -523,7 +523,7 @@ export class TilesRenderer extends TilesRendererBase {

tile.cached = {

loadIndex: 0,
_loadIndex: 0,
transform,
transformInverse,

Expand All @@ -544,7 +544,8 @@ export class TilesRenderer extends TilesRendererBase {

async parseTile( buffer, tile, extension ) {

tile._loadIndex ++;
const cached = tile.cached;
cached._loadIndex ++;

const uri = tile.content.uri;
const uriSplits = uri.split( /[\\/]/g );
Expand All @@ -553,11 +554,10 @@ export class TilesRenderer extends TilesRendererBase {
const fetchOptions = this.fetchOptions;

const manager = this.manager;
const loadIndex = tile._loadIndex;
const loadIndex = cached._loadIndex;
let promise = null;

const upAxis = this.rootTileSet.asset && this.rootTileSet.asset.gltfUpAxis || 'y';
const cached = tile.cached;
const cachedTransform = cached.transform;

const upAdjustment = new Matrix4();
Expand Down Expand Up @@ -681,7 +681,7 @@ export class TilesRenderer extends TilesRendererBase {
} );

// exit early if a new request has already started
if ( tile._loadIndex !== loadIndex ) {
if ( cached._loadIndex !== loadIndex ) {

return;

Expand Down Expand Up @@ -863,7 +863,7 @@ export class TilesRenderer extends TilesRendererBase {

this.activeTiles.delete( tile );
this.visibleTiles.delete( tile );
tile._loadIndex ++;
cached._loadIndex ++;

}

Expand Down

0 comments on commit c46d59c

Please sign in to comment.