f635e18152664885ac909517be1f35041782c78d1c6d372fffa8962f934a97e8.json 3.7 KB

1
  1. {"ast":null,"code":"import { ShaderDefineExpression } from \"../shaderDefineExpression.js\";\n/** @internal */\nexport class ShaderDefineArithmeticOperator extends ShaderDefineExpression {\n constructor(define, operand, testValue) {\n super();\n this.define = define;\n this.operand = operand;\n this.testValue = testValue;\n }\n isTrue(preprocessors) {\n let value = preprocessors[this.define];\n if (value === undefined) {\n value = this.define;\n }\n let condition = false;\n const left = parseInt(value);\n const right = parseInt(this.testValue);\n switch (this.operand) {\n case \">\":\n condition = left > right;\n break;\n case \"<\":\n condition = left < right;\n break;\n case \"<=\":\n condition = left <= right;\n break;\n case \">=\":\n condition = left >= right;\n break;\n case \"==\":\n condition = left === right;\n break;\n case \"!=\":\n condition = left !== right;\n break;\n }\n return condition;\n }\n}","map":{"version":3,"names":["ShaderDefineExpression","ShaderDefineArithmeticOperator","constructor","define","operand","testValue","isTrue","preprocessors","value","undefined","condition","left","parseInt","right"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Engines/Processors/Expressions/Operators/shaderDefineArithmeticOperator.js"],"sourcesContent":["import { ShaderDefineExpression } from \"../shaderDefineExpression.js\";\n/** @internal */\nexport class ShaderDefineArithmeticOperator extends ShaderDefineExpression {\n constructor(define, operand, testValue) {\n super();\n this.define = define;\n this.operand = operand;\n this.testValue = testValue;\n }\n isTrue(preprocessors) {\n let value = preprocessors[this.define];\n if (value === undefined) {\n value = this.define;\n }\n let condition = false;\n const left = parseInt(value);\n const right = parseInt(this.testValue);\n switch (this.operand) {\n case \">\":\n condition = left > right;\n break;\n case \"<\":\n condition = left < right;\n break;\n case \"<=\":\n condition = left <= right;\n break;\n case \">=\":\n condition = left >= right;\n break;\n case \"==\":\n condition = left === right;\n break;\n case \"!=\":\n condition = left !== right;\n break;\n }\n return condition;\n }\n}\n"],"mappings":"AAAA,SAASA,sBAAsB,QAAQ,8BAA8B;AACrE;AACA,OAAO,MAAMC,8BAA8B,SAASD,sBAAsB,CAAC;EACvEE,WAAWA,CAACC,MAAM,EAAEC,OAAO,EAAEC,SAAS,EAAE;IACpC,KAAK,CAAC,CAAC;IACP,IAAI,CAACF,MAAM,GAAGA,MAAM;IACpB,IAAI,CAACC,OAAO,GAAGA,OAAO;IACtB,IAAI,CAACC,SAAS,GAAGA,SAAS;EAC9B;EACAC,MAAMA,CAACC,aAAa,EAAE;IAClB,IAAIC,KAAK,GAAGD,aAAa,CAAC,IAAI,CAACJ,MAAM,CAAC;IACtC,IAAIK,KAAK,KAAKC,SAAS,EAAE;MACrBD,KAAK,GAAG,IAAI,CAACL,MAAM;IACvB;IACA,IAAIO,SAAS,GAAG,KAAK;IACrB,MAAMC,IAAI,GAAGC,QAAQ,CAACJ,KAAK,CAAC;IAC5B,MAAMK,KAAK,GAAGD,QAAQ,CAAC,IAAI,CAACP,SAAS,CAAC;IACtC,QAAQ,IAAI,CAACD,OAAO;MAChB,KAAK,GAAG;QACJM,SAAS,GAAGC,IAAI,GAAGE,KAAK;QACxB;MACJ,KAAK,GAAG;QACJH,SAAS,GAAGC,IAAI,GAAGE,KAAK;QACxB;MACJ,KAAK,IAAI;QACLH,SAAS,GAAGC,IAAI,IAAIE,KAAK;QACzB;MACJ,KAAK,IAAI;QACLH,SAAS,GAAGC,IAAI,IAAIE,KAAK;QACzB;MACJ,KAAK,IAAI;QACLH,SAAS,GAAGC,IAAI,KAAKE,KAAK;QAC1B;MACJ,KAAK,IAAI;QACLH,SAAS,GAAGC,IAAI,KAAKE,KAAK;QAC1B;IACR;IACA,OAAOH,SAAS;EACpB;AACJ","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}