UNPKG

@polygonjs/polygonjs

Version:

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

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