1 |
- {"ast":null,"code":"import { __decorate } from \"../../../tslib.es6.js\";\nimport { NodeMaterialBlock } from \"../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { editableInPropertyPage } from \"../../../Decorators/nodeDecorator.js\";\n/**\n * Operations supported by the Wave block\n */\nexport var WaveBlockKind;\n(function (WaveBlockKind) {\n /** SawTooth */\n WaveBlockKind[WaveBlockKind[\"SawTooth\"] = 0] = \"SawTooth\";\n /** Square */\n WaveBlockKind[WaveBlockKind[\"Square\"] = 1] = \"Square\";\n /** Triangle */\n WaveBlockKind[WaveBlockKind[\"Triangle\"] = 2] = \"Triangle\";\n})(WaveBlockKind || (WaveBlockKind = {}));\n/**\n * Block used to apply wave operation to floats\n */\nexport class WaveBlock extends NodeMaterialBlock {\n /**\n * Creates a new WaveBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n /**\n * Gets or sets the kibnd of wave to be applied by the block\n */\n this.kind = 0 /* WaveBlockKind.SawTooth */;\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"WaveBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const output = this._outputs[0];\n switch (this.kind) {\n case 0 /* WaveBlockKind.SawTooth */:\n {\n state.compilationString += state._declareOutput(output) + ` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});\\n`;\n break;\n }\n case 1 /* WaveBlockKind.Square */:\n {\n state.compilationString += state._declareOutput(output) + ` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));\\n`;\n break;\n }\n case 2 /* WaveBlockKind.Triangle */:\n {\n state.compilationString += state._declareOutput(output) + ` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;\\n`;\n break;\n }\n }\n return this;\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.kind = this.kind;\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n this.kind = serializationObject.kind;\n }\n}\n__decorate([editableInPropertyPage(\"Kind\", 4 /* PropertyTypeForEdition.List */, \"ADVANCED\", {\n notifiers: {\n rebuild: true\n },\n embedded: true,\n options: [{\n label: \"SawTooth\",\n value: 0 /* WaveBlockKind.SawTooth */\n }, {\n label: \"Square\",\n value: 1 /* WaveBlockKind.Square */\n }, {\n label: \"Triangle\",\n value: 2 /* WaveBlockKind.Triangle */\n }]\n})], WaveBlock.prototype, \"kind\", void 0);\nRegisterClass(\"BABYLON.WaveBlock\", WaveBlock);","map":{"version":3,"names":["__decorate","NodeMaterialBlock","NodeMaterialBlockConnectionPointTypes","NodeMaterialBlockTargets","RegisterClass","editableInPropertyPage","WaveBlockKind","WaveBlock","constructor","name","Neutral","kind","registerInput","AutoDetect","registerOutput","BasedOnInput","_outputs","_typeConnectionSource","_inputs","excludedConnectionPointTypes","push","Matrix","getClassName","input","output","_buildBlock","state","compilationString","_declareOutput","associatedVariableName","serialize","serializationObject","_deserialize","scene","rootUrl","notifiers","rebuild","embedded","options","label","value","prototype"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/@babylonjs/core/Materials/Node/Blocks/waveBlock.js"],"sourcesContent":["import { __decorate } from \"../../../tslib.es6.js\";\nimport { NodeMaterialBlock } from \"../nodeMaterialBlock.js\";\nimport { NodeMaterialBlockConnectionPointTypes } from \"../Enums/nodeMaterialBlockConnectionPointTypes.js\";\nimport { NodeMaterialBlockTargets } from \"../Enums/nodeMaterialBlockTargets.js\";\nimport { RegisterClass } from \"../../../Misc/typeStore.js\";\nimport { editableInPropertyPage } from \"../../../Decorators/nodeDecorator.js\";\n/**\n * Operations supported by the Wave block\n */\nexport var WaveBlockKind;\n(function (WaveBlockKind) {\n /** SawTooth */\n WaveBlockKind[WaveBlockKind[\"SawTooth\"] = 0] = \"SawTooth\";\n /** Square */\n WaveBlockKind[WaveBlockKind[\"Square\"] = 1] = \"Square\";\n /** Triangle */\n WaveBlockKind[WaveBlockKind[\"Triangle\"] = 2] = \"Triangle\";\n})(WaveBlockKind || (WaveBlockKind = {}));\n/**\n * Block used to apply wave operation to floats\n */\nexport class WaveBlock extends NodeMaterialBlock {\n /**\n * Creates a new WaveBlock\n * @param name defines the block name\n */\n constructor(name) {\n super(name, NodeMaterialBlockTargets.Neutral);\n /**\n * Gets or sets the kibnd of wave to be applied by the block\n */\n this.kind = 0 /* WaveBlockKind.SawTooth */;\n this.registerInput(\"input\", NodeMaterialBlockConnectionPointTypes.AutoDetect);\n this.registerOutput(\"output\", NodeMaterialBlockConnectionPointTypes.BasedOnInput);\n this._outputs[0]._typeConnectionSource = this._inputs[0];\n this._inputs[0].excludedConnectionPointTypes.push(NodeMaterialBlockConnectionPointTypes.Matrix);\n }\n /**\n * Gets the current class name\n * @returns the class name\n */\n getClassName() {\n return \"WaveBlock\";\n }\n /**\n * Gets the input component\n */\n get input() {\n return this._inputs[0];\n }\n /**\n * Gets the output component\n */\n get output() {\n return this._outputs[0];\n }\n _buildBlock(state) {\n super._buildBlock(state);\n const output = this._outputs[0];\n switch (this.kind) {\n case 0 /* WaveBlockKind.SawTooth */: {\n state.compilationString += state._declareOutput(output) + ` = ${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName});\\n`;\n break;\n }\n case 1 /* WaveBlockKind.Square */: {\n state.compilationString += state._declareOutput(output) + ` = 1.0 - 2.0 * round(fract(${this.input.associatedVariableName}));\\n`;\n break;\n }\n case 2 /* WaveBlockKind.Triangle */: {\n state.compilationString +=\n state._declareOutput(output) + ` = 2.0 * abs(2.0 * (${this.input.associatedVariableName} - floor(0.5 + ${this.input.associatedVariableName}))) - 1.0;\\n`;\n break;\n }\n }\n return this;\n }\n serialize() {\n const serializationObject = super.serialize();\n serializationObject.kind = this.kind;\n return serializationObject;\n }\n _deserialize(serializationObject, scene, rootUrl) {\n super._deserialize(serializationObject, scene, rootUrl);\n this.kind = serializationObject.kind;\n }\n}\n__decorate([\n editableInPropertyPage(\"Kind\", 4 /* PropertyTypeForEdition.List */, \"ADVANCED\", {\n notifiers: { rebuild: true },\n embedded: true,\n options: [\n { label: \"SawTooth\", value: 0 /* WaveBlockKind.SawTooth */ },\n { label: \"Square\", value: 1 /* WaveBlockKind.Square */ },\n { label: \"Triangle\", value: 2 /* WaveBlockKind.Triangle */ },\n ],\n })\n], WaveBlock.prototype, \"kind\", void 0);\nRegisterClass(\"BABYLON.WaveBlock\", WaveBlock);\n"],"mappings":"AAAA,SAASA,UAAU,QAAQ,uBAAuB;AAClD,SAASC,iBAAiB,QAAQ,yBAAyB;AAC3D,SAASC,qCAAqC,QAAQ,mDAAmD;AACzG,SAASC,wBAAwB,QAAQ,sCAAsC;AAC/E,SAASC,aAAa,QAAQ,4BAA4B;AAC1D,SAASC,sBAAsB,QAAQ,sCAAsC;AAC7E;AACA;AACA;AACA,OAAO,IAAIC,aAAa;AACxB,CAAC,UAAUA,aAAa,EAAE;EACtB;EACAA,aAAa,CAACA,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG,UAAU;EACzD;EACAA,aAAa,CAACA,aAAa,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,GAAG,QAAQ;EACrD;EACAA,aAAa,CAACA,aAAa,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,GAAG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