UNPKG

@polygonjs/polygonjs

Version:

node-based WebGL 3D engine https://polygonjs.com

33 lines (32 loc) 1.04 kB
"use strict"; import { Poly } from "../../Poly"; import { JsConnectionPointType } from "../utils/io/connections/Js"; import { MathFunctionArg2OperationFactory } from "./_Math_Arg1Operation"; var RandInput = /* @__PURE__ */ ((RandInput2) => { RandInput2["value0"] = "value0"; RandInput2["value1"] = "value1"; return RandInput2; })(RandInput || {}); const DefaultValues = { ["value0" /* value0 */]: 0, ["value1" /* value1 */]: 0 }; const FUNCTION_NAME = "rand"; export class RandJsNode extends MathFunctionArg2OperationFactory("rand", { inputPrefix: "in", out: "rand" }) { _coreFunction(shadersCollectionController) { Poly.namedFunctionsRegister.getFunction(FUNCTION_NAME, this, shadersCollectionController).asString("", ""); return FUNCTION_NAME; } paramDefaultValue(name) { return DefaultValues[name]; } _expectedInputName(index) { return ["value0" /* value0 */, "value1" /* value1 */][index]; } _expectedInputTypes() { return [JsConnectionPointType.FLOAT, JsConnectionPointType.FLOAT]; } }