private _updateImagePlanes()

in src/component/image/ImageGLRenderer.ts [225:270]


    private _updateImagePlanes(state: IAnimationState): boolean {
        if (state.currentImage == null ||
            state.currentImage.id === this._currentKey) {
            return false;
        }

        let previousKey: string = state.previousImage != null ? state.previousImage.id : null;
        let currentKey: string = state.currentImage.id;

        if (this._previousKey !== previousKey &&
            this._previousKey !== currentKey &&
            this._previousKey in this._providerDisposers) {

            let disposeProvider: () => void = this._providerDisposers[this._previousKey];
            disposeProvider();

            delete this._providerDisposers[this._previousKey];
        }

        if (previousKey != null) {
            if (previousKey !== this._currentKey && previousKey !== this._previousKey) {
                let previousMesh: THREE.Mesh =
                    this._factory.createMesh(state.previousImage, state.previousTransform);

                const previousPlanes: { [key: string]: THREE.Mesh } = {};
                previousPlanes[previousKey] = previousMesh;
                this._scene.updateImagePlanes(previousPlanes);
            }

            this._previousKey = previousKey;
        }

        this._currentKey = currentKey;
        let currentMesh =
            this._factory.createMesh(
                state.currentImage,
                state.currentTransform);

        const planes: { [key: string]: THREE.Mesh } = {};
        planes[currentKey] = currentMesh;
        this._scene.updateImagePlanes(planes);

        this._alphaOld = 1;

        return true;
    }