UNPKG

@polygonjs/polygonjs

Version:

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

50 lines (49 loc) 1.55 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { CameraCSSRendererSopOperation } from "../../operations/sop/CameraCSSRenderer"; import { HierarchyParamConfigAll, ParamConfig } from "../utils/params/ParamsConfig"; import { CameraSopNodeType, NodeContext } from "../../poly/NodeContext"; class CameraCSSRendererSopParamsConfig extends HierarchyParamConfigAll { constructor() { super(...arguments); /** @param renderer */ this.node = ParamConfig.NODE_PATH("", { nodeSelection: { context: NodeContext.ROP }, dependentOnFoundNode: true }); } } const ParamsConfig = new CameraCSSRendererSopParamsConfig(); export class CameraCSSRendererSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; /* children */ this._childrenControllerContext = NodeContext.ROP; } static type() { return CameraSopNodeType.CSS_RENDERER; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState(CameraCSSRendererSopOperation.INPUT_CLONED_STATE); } cook(inputCoreGroups) { this._operation = this._operation || new CameraCSSRendererSopOperation(this._scene, this.states, this); const core_group = this._operation.cook(inputCoreGroups, this.pv); this.setCoreGroup(core_group); } createNode(node_class, options) { return super.createNode(node_class, options); } children() { return super.children(); } nodesByType(type) { return super.nodesByType(type); } }