2021-04-19 07:53:25 +08:00
|
|
|
import { Camera } from 'three'
|
|
|
|
import { defineComponent, inject } from 'vue'
|
|
|
|
// import Object3D from './Object3D'
|
|
|
|
|
|
|
|
interface ThreeInterface {
|
|
|
|
camera?: Camera
|
|
|
|
}
|
2021-03-22 21:30:25 +08:00
|
|
|
|
2021-04-04 04:19:57 +08:00
|
|
|
export default defineComponent({
|
2021-04-19 07:53:25 +08:00
|
|
|
// TODO: eventually extend Object3D
|
2021-03-22 21:30:25 +08:00
|
|
|
// extends: Object3D,
|
2021-04-19 07:53:25 +08:00
|
|
|
// inject: ['three'], // don't work with typescript, bug ?
|
|
|
|
setup() {
|
|
|
|
// this works in sub component ??
|
|
|
|
const three = inject('three') as ThreeInterface
|
|
|
|
return { three }
|
|
|
|
},
|
2021-03-22 21:30:25 +08:00
|
|
|
render() {
|
2021-04-16 07:56:52 +08:00
|
|
|
return this.$slots.default ? this.$slots.default() : []
|
2021-03-22 21:30:25 +08:00
|
|
|
},
|
2021-04-16 07:56:52 +08:00
|
|
|
})
|