Skip to content

Commit ae73496

Browse files
Merge pull request #184 from D4ve-R/gltfloader
Update gltf.ts add onProgress to gltfLoader for issue #176
2 parents 9a1697e + b63f4cc commit ae73496

File tree

1 file changed

+3
-2
lines changed
  • viewer/src/components/import-export

1 file changed

+3
-2
lines changed

viewer/src/components/import-export/glTF.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,9 +89,10 @@ export class GLTFManager extends IfcComponent {
8989
/**
9090
* Loads any glTF file into the scene using [Three.js loader](https://threejs.org/docs/#examples/en/loaders/GLTFLoader).
9191
* @url The URL of the GLTF file to load
92+
* @onProgress (optional) A callback function that is called when the file is loaded
9293
*/
93-
async load(url: string) {
94-
const loaded = (await this.loader.loadAsync(url)) as GLTF;
94+
async load(url: string, onProgress?: (event: ProgressEvent<EventTarget>) => void) {
95+
const loaded = (await this.loader.loadAsync(url, onProgress)) as GLTF;
9596
const mesh = loaded.scene;
9697
const modelID = this.getModelID();
9798
this.GLTFModels[modelID] = mesh;

0 commit comments

Comments
 (0)