@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
27 lines (26 loc) • 957 B
JavaScript
;
import { TypedSopNode } from "./_Base";
import { NodeParamsConfig } from "../utils/params/ParamsConfig";
import { SpotLightParamConfig } from "../../../core/lights/SpotLight";
import { SpotLightSopOperation } from "../../operations/sop/SpotLight";
import { LightType } from "../../poly/registers/nodes/types/Light";
class SpotLightSopParamsConfig extends SpotLightParamConfig(NodeParamsConfig) {
}
const ParamsConfig = new SpotLightSopParamsConfig();
export class SpotLightSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.paramsConfig = ParamsConfig;
}
static type() {
return LightType.SPOT;
}
initializeNode() {
this.io.inputs.setCount(0);
}
async cook(inputCoreGroups) {
this._operation = this._operation || new SpotLightSopOperation(this._scene, this.states, this);
const coreGroup = await this._operation.cook(inputCoreGroups, this.pv);
this.setCoreGroup(coreGroup);
}
}