mirror of
https://github.com/troisjs/trois.git
synced 2024-11-23 20:02:32 +08:00
commit
5ad5e878e7
@ -9,6 +9,7 @@ export default defineComponent({
|
||||
this.$emit('before-load', loader)
|
||||
loader.load(this.src, (fbx) => {
|
||||
this.onLoad(fbx)
|
||||
this.initObject3D(fbx)
|
||||
}, this.onProgress, this.onError)
|
||||
},
|
||||
})
|
||||
|
@ -8,7 +8,8 @@ export default defineComponent({
|
||||
const loader = new GLTFLoader()
|
||||
this.$emit('before-load', loader)
|
||||
loader.load(this.src, (gltf) => {
|
||||
this.onLoad(gltf.scene)
|
||||
this.onLoad(gltf)
|
||||
this.initObject3D(gltf.scene)
|
||||
}, this.onProgress, this.onError)
|
||||
},
|
||||
})
|
||||
|
@ -16,7 +16,6 @@ export default defineComponent({
|
||||
methods: {
|
||||
onLoad(model: TObject3D) {
|
||||
this.$emit('load', model)
|
||||
this.initObject3D(model)
|
||||
},
|
||||
onProgress(progress: ProgressEvent) {
|
||||
this.progress = progress.loaded / progress.total
|
||||
|
Loading…
Reference in New Issue
Block a user