AFRAME.registerComponent('disable-culling', {
    init() {
        this.el.addEventListener('model-loaded', () => {
            this.disableCulling()
        })
        this.el.addEventListener('model-changed', () => {
            this.disableCulling()
        })
    },
    disableCulling() {
        const mesh = this.el.getObject3D('mesh')
        mesh.traverse((node) => {
            if (node.isMesh) {
                node.frustumCulled = false
            }
        })
    },
})