@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
33 lines (32 loc) • 1.17 kB
JavaScript
;
import { TypedSopNode } from "./_Base";
import { CameraProjectSopOperation } from "../../operations/sop/CameraProject";
import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig";
import { SopType } from "../../poly/registers/nodes/types/Sop";
const DEFAULT = CameraProjectSopOperation.DEFAULT_PARAMS;
class CameraProjectSopParamsConfig extends NodeParamsConfig {
constructor() {
super(...arguments);
/** @param unproject */
this.project = ParamConfig.BOOLEAN(DEFAULT.project);
}
}
const ParamsConfig = new CameraProjectSopParamsConfig();
export class CameraProjectSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
}
static type() {
return SopType.CAMERA_PROJECT;
}
initializeNode() {
this.io.inputs.setCount(2);
this.io.inputs.initInputsClonedState(CameraProjectSopOperation.INPUT_CLONED_STATE);
}
cook(input_contents) {
this._operation = this._operation || new CameraProjectSopOperation(this._scene, this.states, this);
const coreGroup = this._operation.cook(input_contents, this.pv);
this.setCoreGroup(coreGroup);
}
}