UNPKG

@polygonjs/polygonjs

Version:

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

33 lines (32 loc) 1.33 kB
"use strict"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { BaseLightTransformedObjNode } from "./_BaseLightTransformed"; import { TransformedParamConfig } from "./utils/TransformController"; import { LightType } from "../../poly/registers/nodes/types/Light"; import { DirectionalLightParamConfig } from "../../../core/lights/DirectionalLight"; import { DirectionalLightSopOperation } from "../../operations/sop/DirectionalLight"; class DirectionalLightObjParamsConfig extends DirectionalLightParamConfig(TransformedParamConfig(NodeParamsConfig)) { } const ParamsConfig = new DirectionalLightObjParamsConfig(); export class DirectionalLightObjNode extends BaseLightTransformedObjNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return LightType.DIRECTIONAL; } _operation() { return this.__operation__ = this.__operation__ || new DirectionalLightSopOperation(this._scene, this.states, this); } createLight() { return this._operation().createLight({ showHelper: this.pv.showHelper }); } updateLightParams() { this._operation().updateLightParams(this.light, this.pv); } updateShadowParams() { this.light.showHelper = this.pv.showHelper; this._operation().updateShadowParams(this.light, this.pv); } }