import { VolumetricLoader } from "../utils/VolumetricLoader";
export class AlVolumetricModel {
    static get Object() {
        return {
            schema: {
                src: { type: "model", default: "" }
            },
            init() {
                this.onEnterVR = this.onEnterVR.bind(this);
                this.onExitVR = this.onExitVR.bind(this);
                this.model = null;
                this.loader = new VolumetricLoader();
            },
            update() {
                let el = this.el;
                let src = this.data.src;
                if (!src) {
                    return;
                }
                this.remove();
                this.loader.load(src, el).then(stack => {
                    console.log("stack loaded", stack);
                });
            },
            remove() {
                if (!this.model) {
                    return;
                }
                this.el.removeObject3D("mesh");
            }
        };
    }
    static get Tag() {
        return "al-volumetric-model";
    }
}
