@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
50 lines (49 loc) • 1.52 kB
JavaScript
;
import { TypedSopNode } from "./_Base";
import { CameraRendererSopOperation } from "../../operations/sop/CameraRenderer";
import { HierarchyParamConfigAll, ParamConfig } from "../utils/params/ParamsConfig";
import { CameraSopNodeType, NodeContext } from "../../poly/NodeContext";
class CameraRendererSopParamsConfig extends HierarchyParamConfigAll {
constructor() {
super(...arguments);
/** @param renderer */
this.node = ParamConfig.NODE_PATH("", {
nodeSelection: {
context: NodeContext.ROP
},
dependentOnFoundNode: true
});
}
}
const ParamsConfig = new CameraRendererSopParamsConfig();
export class CameraRendererSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
/*
children
*/
this._childrenControllerContext = NodeContext.ROP;
}
static type() {
return CameraSopNodeType.RENDERER;
}
initializeNode() {
this.io.inputs.setCount(1);
this.io.inputs.initInputsClonedState(CameraRendererSopOperation.INPUT_CLONED_STATE);
}
cook(inputCoreGroups) {
this._operation = this._operation || new CameraRendererSopOperation(this._scene, this.states, this);
const coreGroup = this._operation.cook(inputCoreGroups, this.pv);
this.setCoreGroup(coreGroup);
}
createNode(node_class, options) {
return super.createNode(node_class, options);
}
children() {
return super.children();
}
nodesByType(type) {
return super.nodesByType(type);
}
}