@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
39 lines (38 loc) • 1.36 kB
JavaScript
;
import { TypedSopNode } from "./_Base";
import { CameraRenderSceneSopOperation } from "../../operations/sop/CameraRenderScene";
import { HierarchyParamConfigAll, ParamConfig } from "../utils/params/ParamsConfig";
import { CameraSopNodeType, NodeContext } from "../../poly/NodeContext";
import { ObjType } from "../../poly/registers/nodes/types/Obj";
class CameraRenderSceneSopParamsConfig extends HierarchyParamConfigAll {
constructor() {
super(...arguments);
/** @param renderer */
this.node = ParamConfig.NODE_PATH("", {
nodeSelection: {
context: NodeContext.OBJ,
types: [ObjType.SCENE]
},
dependentOnFoundNode: true
});
}
}
const ParamsConfig = new CameraRenderSceneSopParamsConfig();
export class CameraRenderSceneSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
}
static type() {
return CameraSopNodeType.RENDER_SCENE;
}
initializeNode() {
this.io.inputs.setCount(1);
this.io.inputs.initInputsClonedState(CameraRenderSceneSopOperation.INPUT_CLONED_STATE);
}
cook(inputCoreGroups) {
this._operation = this._operation || new CameraRenderSceneSopOperation(this._scene, this.states, this);
const core_group = this._operation.cook(inputCoreGroups, this.pv);
this.setCoreGroup(core_group);
}
}