UNPKG

@polygonjs/polygonjs

Version:

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

46 lines (45 loc) 1.6 kB
"use strict"; import { TypedGlNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { NetworkChildNodeType } from "../../poly/NodeContext"; class SubnetInputGlParamsConfig extends NodeParamsConfig { } const ParamsConfig = new SubnetInputGlParamsConfig(); export class SubnetInputGlNode extends TypedGlNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return NetworkChildNodeType.INPUT; } initializeNode() { this.io.connection_points.set_output_name_function(this._expected_output_names.bind(this)); this.io.connection_points.set_expected_input_types_function(() => []); this.io.connection_points.set_expected_output_types_function(this._expected_output_types.bind(this)); } parent() { return super.parent(); } _expected_output_names(index) { const parent = this.parent(); return (parent == null ? void 0 : parent.childExpectedInputConnectionPointName(index)) || `out${index}`; } _expected_output_types() { const parent = this.parent(); return (parent == null ? void 0 : parent.childExpectedInputConnectionPointTypes()) || []; } // private _connect_to_parent_connections_controller() { // // this will make the node update its connections when the parent changes them // if (this.parent) { // this.addGraphInput(this.parent); // } // } setLines(shaders_collection_controller) { const parent = this.parent(); if (!parent) { return; } parent.setSubnetInputLines(shaders_collection_controller, this); } }