UNPKG

@polygonjs/polygonjs

Version:

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

33 lines (32 loc) 1.17 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig"; import { InputCloneMode } from "../../poly/InputCloneMode"; import { BboxScatterSopOperation } from "../../operations/sop/BboxScatter"; import { SopType } from "../../poly/registers/nodes/types/Sop"; class BboxScatterSopParamsConfig extends NodeParamsConfig { constructor() { super(...arguments); /** @param the smaller the step size, the more points this will create */ this.stepSize = ParamConfig.FLOAT(0.1); } } const ParamsConfig = new BboxScatterSopParamsConfig(); export class BboxScatterSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return SopType.BBOX_SCATTER; } initializeNode() { this.io.inputs.setCount(1); this.io.inputs.initInputsClonedState(InputCloneMode.NEVER); } cook(input_contents) { this._operation = this._operation || new BboxScatterSopOperation(this._scene, this.states, this); const core_group = this._operation.cook(input_contents, this.pv); this.setCoreGroup(core_group); } }