mirror of
https://github.com/troisjs/trois.git
synced 2024-11-24 04:12:02 +08:00
gltf no animations
This commit is contained in:
parent
aee1719ed1
commit
447e4d9735
@ -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)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -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)
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
@ -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
|
||||||
|
Loading…
Reference in New Issue
Block a user