@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
42 lines (41 loc) • 1.57 kB
JavaScript
;
import { TypedGlNode } from "./_Base";
import { NodeParamsConfig } from "../utils/params/ParamsConfig";
import { NetworkChildNodeType } from "../../poly/NodeContext";
class SubnetOutputGlParamsConfig extends NodeParamsConfig {
}
const ParamsConfig = new SubnetOutputGlParamsConfig();
export class SubnetOutputGlNode extends TypedGlNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
}
static type() {
return NetworkChildNodeType.OUTPUT;
}
initializeNode() {
this.io.connection_points.set_input_name_function(this._expected_input_name.bind(this));
this.io.connection_points.set_expected_output_types_function(() => []);
this.io.connection_points.set_expected_input_types_function(this._expected_input_types.bind(this));
this.io.connection_points.set_create_spare_params_from_inputs(false);
this.addPostDirtyHook("setParentDirty", () => {
var _a;
(_a = this.parent()) == null ? void 0 : _a.setDirty(this);
});
}
parent() {
return super.parent();
}
_expected_input_name(index) {
const parent = this.parent();
return (parent == null ? void 0 : parent.childExpectedOutputConnectionPointName(index)) || `in${index}`;
}
_expected_input_types() {
const parent = this.parent();
return (parent == null ? void 0 : parent.childExpectedOutputConnectionPointTypes()) || [];
}
setLines(shadersCollectionController) {
const parent = this.parent();
parent == null ? void 0 : parent.setSubnetOutputLines(shadersCollectionController, this);
}
}