Skip to content

Commit

Permalink
feat(TilesRenderer): add the load-model-start event (#906)
Browse files Browse the repository at this point in the history
  • Loading branch information
sguimmara committed Jan 6, 2025
1 parent 82d89b1 commit eacd20c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/three/TilesRenderer.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface TilesRendererEventMap {
'tiles-load-start': {};
'tiles-load-end': {};
'load-content': {};
'load-model-start': { tile: Tile };
'load-model': { scene: Object3D; tile: Tile };
'dispose-model': { scene: Object3D; tile: Tile };
'tile-visibility-change': { scene: Object3D; tile: Tile; visible: boolean };
Expand Down
6 changes: 6 additions & 0 deletions src/three/TilesRenderer.js
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,12 @@ export class TilesRenderer extends TilesRendererBase {

async parseTile( buffer, tile, extension, uri ) {

// dispatch an event indicating that this model has started loading
this.dispatchEvent( {
type: 'load-model-start',
tile,
} );

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

Expand Down

0 comments on commit eacd20c

Please sign in to comment.