85d4d5d2dd36c636d76dcf8e89bd88a8b933179a83eb5f603f25992e82e498e1.json 14 KB

1
  1. {"ast":null,"code":"/**\n * @internal\n **/\nexport class DepthCullingState {\n /**\n * Initializes the state.\n * @param reset\n */\n constructor(reset = true) {\n this._isDepthTestDirty = false;\n this._isDepthMaskDirty = false;\n this._isDepthFuncDirty = false;\n this._isCullFaceDirty = false;\n this._isCullDirty = false;\n this._isZOffsetDirty = false;\n this._isFrontFaceDirty = false;\n if (reset) {\n this.reset();\n }\n }\n get isDirty() {\n return this._isDepthFuncDirty || this._isDepthTestDirty || this._isDepthMaskDirty || this._isCullFaceDirty || this._isCullDirty || this._isZOffsetDirty || this._isFrontFaceDirty;\n }\n get zOffset() {\n return this._zOffset;\n }\n set zOffset(value) {\n if (this._zOffset === value) {\n return;\n }\n this._zOffset = value;\n this._isZOffsetDirty = true;\n }\n get zOffsetUnits() {\n return this._zOffsetUnits;\n }\n set zOffsetUnits(value) {\n if (this._zOffsetUnits === value) {\n return;\n }\n this._zOffsetUnits = value;\n this._isZOffsetDirty = true;\n }\n get cullFace() {\n return this._cullFace;\n }\n set cullFace(value) {\n if (this._cullFace === value) {\n return;\n }\n this._cullFace = value;\n this._isCullFaceDirty = true;\n }\n get cull() {\n return this._cull;\n }\n set cull(value) {\n if (this._cull === value) {\n return;\n }\n this._cull = value;\n this._isCullDirty = true;\n }\n get depthFunc() {\n return this._depthFunc;\n }\n set depthFunc(value) {\n if (this._depthFunc === value) {\n return;\n }\n this._depthFunc = value;\n this._isDepthFuncDirty = true;\n }\n get depthMask() {\n return this._depthMask;\n }\n set depthMask(value) {\n if (this._depthMask === value) {\n return;\n }\n this._depthMask = value;\n this._isDepthMaskDirty = true;\n }\n get depthTest() {\n return this._depthTest;\n }\n set depthTest(value) {\n if (this._depthTest === value) {\n return;\n }\n this._depthTest = value;\n this._isDepthTestDirty = true;\n }\n get frontFace() {\n return this._frontFace;\n }\n set frontFace(value) {\n if (this._frontFace === value) {\n return;\n }\n this._frontFace = value;\n this._isFrontFaceDirty = true;\n }\n reset() {\n this._depthMask = true;\n this._depthTest = true;\n this._depthFunc = null;\n this._cullFace = null;\n this._cull = null;\n this._zOffset = 0;\n this._zOffsetUnits = 0;\n this._frontFace = null;\n this._isDepthTestDirty = true;\n this._isDepthMaskDirty = true;\n this._isDepthFuncDirty = false;\n this._isCullFaceDirty = false;\n this._isCullDirty = false;\n this._isZOffsetDirty = true;\n this._isFrontFaceDirty = false;\n }\n apply(gl) {\n if (!this.isDirty) {\n return;\n }\n // Cull\n if (this._isCullDirty) {\n if (this.cull) {\n gl.enable(gl.CULL_FACE);\n } else {\n gl.disable(gl.CULL_FACE);\n }\n this._isCullDirty = false;\n }\n // Cull face\n if (this._isCullFaceDirty) {\n gl.cullFace(this.cullFace);\n this._isCullFaceDirty = false;\n }\n // Depth mask\n if (this._isDepthMaskDirty) {\n gl.depthMask(this.depthMask);\n this._isDepthMaskDirty = false;\n }\n // Depth test\n if (this._isDepthTestDirty) {\n if (this.depthTest) {\n gl.enable(gl.DEPTH_TEST);\n } else {\n gl.disable(gl.DEPTH_TEST);\n }\n this._isDepthTestDirty = false;\n }\n // Depth func\n if (this._isDepthFuncDirty) {\n gl.depthFunc(this.depthFunc);\n this._isDepthFuncDirty = false;\n }\n // zOffset\n if (this._isZOffsetDirty) {\n if (this.zOffset || this.zOffsetUnits) {\n gl.enable(gl.POLYGON_OFFSET_FILL);\n gl.polygonOffset(this.zOffset, this.zOffsetUnits);\n } else {\n gl.disable(gl.POLYGON_OFFSET_FILL);\n }\n this._isZOffsetDirty = false;\n }\n // Front face\n if (this._isFrontFaceDirty) {\n gl.frontFace(this.frontFace);\n this._isFrontFaceDirty = false;\n }\n }\n}","map":{"version":3,"names":["DepthCullingState","constructor","reset","_isDepthTestDirty","_isDepthMaskDirty","_isDepthFuncDirty","_isCullFaceDirty","_isCullDirty","_isZOffsetDirty","_isFrontFaceDirty","isDirty","zOffset","_zOffset","value","zOffsetUnits","_zOffsetUnits","cullFace","_cullFace","cull","_cull","depthFunc","_depthFunc","depthMask","_depthMask","depthTest","_depthTest","frontFace","_frontFace","apply","gl","enable","CULL_FACE","disable","DEPTH_TEST","POLYGON_OFFSET_FILL","polygonOffset"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/States/depthCullingState.js"],"sourcesContent":["/**\n * @internal\n **/\nexport class DepthCullingState {\n /**\n * Initializes the state.\n * @param reset\n */\n constructor(reset = true) {\n this._isDepthTestDirty = false;\n this._isDepthMaskDirty = false;\n this._isDepthFuncDirty = false;\n this._isCullFaceDirty = false;\n this._isCullDirty = false;\n this._isZOffsetDirty = false;\n this._isFrontFaceDirty = false;\n if (reset) {\n this.reset();\n }\n }\n get isDirty() {\n return (this._isDepthFuncDirty ||\n this._isDepthTestDirty ||\n this._isDepthMaskDirty ||\n this._isCullFaceDirty ||\n this._isCullDirty ||\n this._isZOffsetDirty ||\n this._isFrontFaceDirty);\n }\n get zOffset() {\n return this._zOffset;\n }\n set zOffset(value) {\n if (this._zOffset === value) {\n return;\n }\n this._zOffset = value;\n this._isZOffsetDirty = true;\n }\n get zOffsetUnits() {\n return this._zOffsetUnits;\n }\n set zOffsetUnits(value) {\n if (this._zOffsetUnits === value) {\n return;\n }\n this._zOffsetUnits = value;\n this._isZOffsetDirty = true;\n }\n get cullFace() {\n return this._cullFace;\n }\n set cullFace(value) {\n if (this._cullFace === value) {\n return;\n }\n this._cullFace = value;\n this._isCullFaceDirty = true;\n }\n get cull() {\n return this._cull;\n }\n set cull(value) {\n if (this._cull === value) {\n return;\n }\n this._cull = value;\n this._isCullDirty = true;\n }\n get depthFunc() {\n return this._depthFunc;\n }\n set depthFunc(value) {\n if (this._depthFunc === value) {\n return;\n }\n this._depthFunc = value;\n this._isDepthFuncDirty = true;\n }\n get depthMask() {\n return this._depthMask;\n }\n set depthMask(value) {\n if (this._depthMask === value) {\n return;\n }\n this._depthMask = value;\n this._isDepthMaskDirty = true;\n }\n get depthTest() {\n return this._depthTest;\n }\n set depthTest(value) {\n if (this._depthTest === value) {\n return;\n }\n this._depthTest = value;\n this._isDepthTestDirty = true;\n }\n get frontFace() {\n return this._frontFace;\n }\n set frontFace(value) {\n if (this._frontFace === value) {\n return;\n }\n this._frontFace = value;\n this._isFrontFaceDirty = true;\n }\n reset() {\n this._depthMask = true;\n this._depthTest = true;\n this._depthFunc = null;\n this._cullFace = null;\n this._cull = null;\n this._zOffset = 0;\n this._zOffsetUnits = 0;\n this._frontFace = null;\n this._isDepthTestDirty = true;\n this._isDepthMaskDirty = true;\n this._isDepthFuncDirty = false;\n this._isCullFaceDirty = false;\n this._isCullDirty = false;\n this._isZOffsetDirty = true;\n this._isFrontFaceDirty = false;\n }\n apply(gl) {\n if (!this.isDirty) {\n return;\n }\n // Cull\n if (this._isCullDirty) {\n if (this.cull) {\n gl.enable(gl.CULL_FACE);\n }\n else {\n gl.disable(gl.CULL_FACE);\n }\n this._isCullDirty = false;\n }\n // Cull face\n if (this._isCullFaceDirty) {\n gl.cullFace(this.cullFace);\n this._isCullFaceDirty = false;\n }\n // Depth mask\n if (this._isDepthMaskDirty) {\n gl.depthMask(this.depthMask);\n this._isDepthMaskDirty = false;\n }\n // Depth test\n if (this._isDepthTestDirty) {\n if (this.depthTest) {\n gl.enable(gl.DEPTH_TEST);\n }\n else {\n gl.disable(gl.DEPTH_TEST);\n }\n this._isDepthTestDirty = false;\n }\n // Depth func\n if (this._isDepthFuncDirty) {\n gl.depthFunc(this.depthFunc);\n this._isDepthFuncDirty = false;\n }\n // zOffset\n if (this._isZOffsetDirty) {\n if (this.zOffset || this.zOffsetUnits) {\n gl.enable(gl.POLYGON_OFFSET_FILL);\n gl.polygonOffset(this.zOffset, this.zOffsetUnits);\n }\n else {\n gl.disable(gl.POLYGON_OFFSET_FILL);\n }\n this._isZOffsetDirty = false;\n }\n // Front face\n if (this._isFrontFaceDirty) {\n gl.frontFace(this.frontFace);\n this._isFrontFaceDirty = false;\n }\n }\n}\n"],"mappings":"AAAA;AACA;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AI,CAACV,gBAAgB,GAAG,KAAK;IACjC;IACA;IACA,IAAI,IAAI,CAACF,iBAAiB,EAAE;MACxByB,EAAE,CAACP,SAAS,CAAC,IAAI,CAACA,SAAS,CAAC;MAC5B,IAAI,CAAClB,iBAAiB,GAAG,KAAK;IAClC;IACA;IACA,IAAI,IAAI,CAACD,iBAAiB,EAAE;MACxB,IAAI,IAAI,CAACqB,SAAS,EAAE;QAChBK,EAAE,CAACC,MAAM,CAACD,EAAE,CAACI,UAAU,CAAC;MAC5B,CAAC,MACI;QACDJ,EAAE,CAACG,OAAO,CAACH,EAAE,CAACI,UAAU,CAAC;MAC7B;MACA,IAAI,CAAC9B,iBAAiB,GAAG,KAAK;IAClC;IACA;IACA,IAAI,IAAI,CAACE,iBAAiB,EAAE;MACxBwB,EAAE,CAACT,SAAS,CAAC,IAAI,CAACA,SAAS,CAAC;MAC5B,IAAI,CAACf,iBAAiB,GAAG,KAAK;IAClC;IACA;IACA,IAAI,IAAI,CAACG,eAAe,EAAE;MACtB,IAAI,IAAI,CAACG,OAAO,IAAI,IAAI,CAACG,YAAY,EAAE;QACnCe,EAAE,CAACC,MAAM,CAACD,EAAE,CAACK,mBAAmB,CAAC;QACjCL,EAAE,CAACM,aAAa,CAAC,IAAI,CAACxB,OAAO,EAAE,IAAI,CAACG,YAAY,CAAC;MACrD,CAAC,MACI;QACDe,EAAE,CAACG,OAAO,CAACH,EAAE,CAACK,mBAAmB,CAAC;MACtC;MACA,IAAI,CAAC1B,eAAe,GAAG,KAAK;IAChC;IACA;IACA,IAAI,IAAI,CAACC,iBAAiB,EAAE;MACxBoB,EAAE,CAACH,SAAS,CAAC,IAAI,CAACA,SAAS,CAAC;MAC5B,IAAI,CAACjB,iBAAiB,GAAG,KAAK;IAClC;EACJ;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}