{"size": 1968, "ext": "js", "max_stars_repo_path": "src/_renderer/chunks/viewTransformChunk.js", "max_stars_repo_name": "aothms/xeogl", "max_stars_repo_stars_event_min_datetime": "2021-06-30T08:00:19.000Z", "max_stars_repo_stars_event_max_datetime": "2021-06-30T08:00:19.000Z", "max_issues_repo_path": "src/_renderer/chunks/viewTransformChunk.js", "max_issues_repo_name": "aothms/xeogl", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "src/_renderer/chunks/viewTransformChunk.js", "max_forks_repo_name": "aothms/xeogl", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 1, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 35.7818181818, "max_line_length": 107, "alphanum_fraction": 0.5980691057}
(function () {

    "use strict";

    xeogl.renderer.ChunkFactory.createChunkType({

        type: "viewTransform",

        build: function () {
            this._uViewMatrixDraw = this.program.draw.getUniform("viewMatrix");
            this._uViewNormalMatrixDraw = this.program.draw.getUniform("viewNormalMatrix");
            this._uViewMatrixShadow = this.program.pickObject.getUniform("shadowViewMatrix");
            this._uViewMatrixPickObject = this.program.pickObject.getUniform("viewMatrix");
            this._uViewMatrixPickPrimitive = this.program.pickPrimitive.getUniform("viewMatrix");
            this._uViewMatrixOutline = this.program.outline.getUniform("viewMatrix");
        },

        draw: function () {
            if (this._uViewMatrixDraw) {
                this._uViewMatrixDraw.setValue(this.state.getMatrix());
            }
            if (this._uViewNormalMatrixDraw) {
                this._uViewNormalMatrixDraw.setValue(this.state.getNormalMatrix());
            }
        },

        shadow: function (frameCtx) {
            if (this._uViewMatrixShadow) {
                this._uViewMatrixShadow.setValue(frameCtx.shadowViewMatrix);
            }
            if (this._uProjMatrixShadow) {
                this._uProjMatrixShadow.setValue(frameCtx.shadowProjMatrix);
            }
        },

        pickObject: function (frameCtx) {
            if (this._uViewMatrixPickObject) {
                this._uViewMatrixPickObject.setValue(frameCtx.pickViewMatrix || this.state.getMatrix());
            }
        },

        pickPrimitive: function (frameCtx) {
            if (this._uViewMatrixPickPrimitive) {
                this._uViewMatrixPickPrimitive.setValue(frameCtx.pickViewMatrix || this.state.getMatrix());
            }
        },

        outline: function () {
            if (this._uViewMatrixOutline) {
                this._uViewMatrixOutline.setValue(this.state.getMatrix());
            }
        }
    });

})();