UNPKG

@babylonjs/core

Version:

Getting started? Play directly with the Babylon.js API using our [playground](https://playground.babylonjs.com/). It also contains a lot of samples to learn how to use it.

37 lines 1.3 kB
import { ShaderDefineExpression } from "../shaderDefineExpression.js"; /** @internal */ export class ShaderDefineArithmeticOperator extends ShaderDefineExpression { constructor(define, operand, testValue) { super(); this.define = define; this.operand = operand; this.testValue = testValue; } isTrue(preprocessors) { let condition = false; const left = parseInt(preprocessors[this.define] != undefined ? preprocessors[this.define] : this.define); const right = parseInt(preprocessors[this.testValue] != undefined ? preprocessors[this.testValue] : this.testValue); switch (this.operand) { case ">": condition = left > right; break; case "<": condition = left < right; break; case "<=": condition = left <= right; break; case ">=": condition = left >= right; break; case "==": condition = left === right; break; case "!=": condition = left !== right; break; } return condition; } } //# sourceMappingURL=shaderDefineArithmeticOperator.js.map