UNPKG

@polygonjs/polygonjs

Version:

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

35 lines (34 loc) 1.37 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { ParticlesSystemGpuAttributesSopOperation } from "../../operations/sop/ParticlesSystemGpuAttributes"; import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig"; import { SopType } from "../../poly/registers/nodes/types/Sop"; const DEFAULT = ParticlesSystemGpuAttributesSopOperation.DEFAULT_PARAMS; class ParticlesSystemGpuAttributesSopParamsConfig extends NodeParamsConfig { constructor() { super(...arguments); /** @param group to assign the material to */ this.group = ParamConfig.STRING(DEFAULT.group, { objectMask: true }); } } const ParamsConfig = new ParticlesSystemGpuAttributesSopParamsConfig(); export class ParticlesSystemGpuAttributesSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return SopType.PARTICLES_SYSTEM_GPU_ATTRIBUTES; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState(ParticlesSystemGpuAttributesSopOperation.INPUT_CLONED_STATE); } async cook(inputCoreGroups) { this._operation = this._operation || new ParticlesSystemGpuAttributesSopOperation(this._scene, this.states, this); const coreGroup = await this._operation.cook(inputCoreGroups, this.pv); this.setCoreGroup(coreGroup); } }