1
0
mirror of https://github.com/troisjs/trois.git synced 2024-11-24 04:12:02 +08:00

Merge pull request #114 from roy2an/master

gltf no animations
This commit is contained in:
Kevin LEVRON 2022-01-24 21:25:54 +01:00 committed by GitHub
commit 5ad5e878e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 3 additions and 2 deletions

View File

@ -9,6 +9,7 @@ export default defineComponent({
this.$emit('before-load', loader) this.$emit('before-load', loader)
loader.load(this.src, (fbx) => { loader.load(this.src, (fbx) => {
this.onLoad(fbx) this.onLoad(fbx)
this.initObject3D(fbx)
}, this.onProgress, this.onError) }, this.onProgress, this.onError)
}, },
}) })

View File

@ -8,7 +8,8 @@ export default defineComponent({
const loader = new GLTFLoader() const loader = new GLTFLoader()
this.$emit('before-load', loader) this.$emit('before-load', loader)
loader.load(this.src, (gltf) => { loader.load(this.src, (gltf) => {
this.onLoad(gltf.scene) this.onLoad(gltf)
this.initObject3D(gltf.scene)
}, this.onProgress, this.onError) }, this.onProgress, this.onError)
}, },
}) })

View File

@ -16,7 +16,6 @@ export default defineComponent({
methods: { methods: {
onLoad(model: TObject3D) { onLoad(model: TObject3D) {
this.$emit('load', model) this.$emit('load', model)
this.initObject3D(model)
}, },
onProgress(progress: ProgressEvent) { onProgress(progress: ProgressEvent) {
this.progress = progress.loaded / progress.total this.progress = progress.loaded / progress.total