UNPKG

@polygonjs/polygonjs

Version:

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

27 lines (26 loc) 1.01 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { DirectionalLightParamConfig } from "../../../core/lights/DirectionalLight"; import { DirectionalLightSopOperation } from "../../operations/sop/DirectionalLight"; import { LightType } from "../../poly/registers/nodes/types/Light"; class DirectionalLightSopParamsConfig extends DirectionalLightParamConfig(NodeParamsConfig) { } const ParamsConfig = new DirectionalLightSopParamsConfig(); export class DirectionalLightSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return LightType.DIRECTIONAL; } initializeNode() { this.io.inputs.setCount(0); } cook(input_contents) { this._operation = this._operation || new DirectionalLightSopOperation(this._scene, this.states, this); const core_group = this._operation.cook(input_contents, this.pv); this.setCoreGroup(core_group); } }