UNPKG

@polygonjs/polygonjs

Version:

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

48 lines (47 loc) 1.89 kB
"use strict"; import { TypedJsNode } from "./_Base"; import { JsConnectionPoint, JsConnectionPointType } from "../utils/io/connections/Js"; import { Matrix4 } from "three"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { Poly } from "../../Poly"; var GetWebXRTrackedMarkerJsNodeInputName = /* @__PURE__ */ ((GetWebXRTrackedMarkerJsNodeInputName2) => { GetWebXRTrackedMarkerJsNodeInputName2["matrix"] = "matrix"; return GetWebXRTrackedMarkerJsNodeInputName2; })(GetWebXRTrackedMarkerJsNodeInputName || {}); class GetWebXRTrackedMarkerJsParamsConfig extends NodeParamsConfig { } const ParamsConfig = new GetWebXRTrackedMarkerJsParamsConfig(); export class GetWebXRTrackedMarkerPropertyJsNode extends TypedJsNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return "getWebXRTrackedMarkerProperty"; } initializeNode() { this.io.inputs.setNamedInputConnectionPoints([]); this.io.outputs.setNamedOutputConnectionPoints([ new JsConnectionPoint("matrix" /* matrix */, JsConnectionPointType.MATRIX4) ]); } setLines(shadersCollectionController) { const usedOutputNames = this.io.outputs.used_output_names(); const _m4 = (propertyName, functionName, type) => { if (!usedOutputNames.includes(propertyName)) { return; } const varName = this.jsVarName(propertyName); const tmpVarName = shadersCollectionController.addVariable(this, new Matrix4()); const func = Poly.namedFunctionsRegister.getFunction(functionName, this, shadersCollectionController); shadersCollectionController.addBodyOrComputed(this, [ { dataType: type, varName, value: func.asString(tmpVarName) } ]); }; _m4("matrix" /* matrix */, "getWebXRTrackedMarkerMatrix", JsConnectionPointType.MATRIX4); } }