UNPKG

@polygonjs/polygonjs

Version:

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

32 lines (31 loc) 1.15 kB
"use strict"; import { TypedLightObjNode } from "./_BaseLight"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { TransformController, TransformedParamConfig } from "./utils/TransformController"; import { FlagsControllerD } from "../utils/FlagsController"; import { HierarchyController } from "./utils/HierarchyController"; import { isPromise } from "../../../core/Type"; class TransformedObjParamConfig extends TransformedParamConfig(NodeParamsConfig) { } export class BaseLightTransformedObjNode extends TypedLightObjNode { constructor() { super(...arguments); this.flags = new FlagsControllerD(this); this.hierarchyController = new HierarchyController(this); this.transformController = new TransformController(this); } initializeBaseNode() { super.initializeBaseNode(); this.hierarchyController.initializeNode(); this.transformController.initializeNode(); } async cook() { this.transformController.update(); this.updateShadowParams(); const result = this.updateLightParams(); if (isPromise(result)) { await result; } this.cookController.endCook(); } }