UNPKG

@polygonjs/polygonjs

Version:

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

27 lines (26 loc) 945 B
"use strict"; import { TypedSopNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { AreaLightParamConfig } from "../../../core/lights/AreaLight"; import { AreaLightSopOperation } from "../../operations/sop/AreaLight"; import { LightType } from "../../poly/registers/nodes/types/Light"; class AreaLightSopParamsConfig extends AreaLightParamConfig(NodeParamsConfig) { } const ParamsConfig = new AreaLightSopParamsConfig(); export class AreaLightSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return LightType.AREA; } initializeNode() { this.io.inputs.setCount(0); } cook(input_contents) { this._operation = this._operation || new AreaLightSopOperation(this._scene, this.states, this); const core_group = this._operation.cook(input_contents, this.pv); this.setCoreGroup(core_group); } }