UNPKG

@polygonjs/polygonjs

Version:

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

39 lines (38 loc) 1.53 kB
"use strict"; import { TRIGGER_CONNECTION_NAME, TypedJsNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { JsConnectionPoint, JsConnectionPointType, JS_CONNECTION_POINT_IN_NODE_DEF } from "../utils/io/connections/Js"; import { setObject3DOutputLine } from "./_BaseObject3D"; const CONNECTION_OPTIONS = JS_CONNECTION_POINT_IN_NODE_DEF; export class BaseTriggerAndObjectJsNode extends TypedJsNode { initializeNode() { this.io.inputs.setNamedInputConnectionPoints([ new JsConnectionPoint(TRIGGER_CONNECTION_NAME, JsConnectionPointType.TRIGGER, CONNECTION_OPTIONS), new JsConnectionPoint(JsConnectionPointType.OBJECT_3D, JsConnectionPointType.OBJECT_3D, CONNECTION_OPTIONS), ...this._additionalInputs() ]); this.io.outputs.setNamedOutputConnectionPoints([ new JsConnectionPoint(TRIGGER_CONNECTION_NAME, JsConnectionPointType.TRIGGER), new JsConnectionPoint(JsConnectionPointType.OBJECT_3D, JsConnectionPointType.OBJECT_3D), ...this._additionalOutputs() ]); } setLines(linesController) { setObject3DOutputLine(this, linesController); } _additionalInputs() { return []; } _additionalOutputs() { return []; } } class BaseTriggerAndObjectJsParamsConfig extends NodeParamsConfig { } const ParamsConfig = new BaseTriggerAndObjectJsParamsConfig(); export class ParamlessBaseTriggerAndObjectJsNode extends BaseTriggerAndObjectJsNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } }