UNPKG

@polygonjs/polygonjs

Version:

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

32 lines (31 loc) 1.07 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { AxesHelperSopOperation } from "../../operations/sop/AxesHelper"; import { NodeParamsConfig, ParamConfig } from "../utils/params/ParamsConfig"; import { SopType } from "../../poly/registers/nodes/types/Sop"; const DEFAULT = AxesHelperSopOperation.DEFAULT_PARAMS; class AxesHelperSopParamsConfig extends NodeParamsConfig { constructor() { super(...arguments); /** @param center of the geometry */ this.center = ParamConfig.VECTOR3(DEFAULT.center); } } const ParamsConfig = new AxesHelperSopParamsConfig(); export class AxesHelperSopNode extends TypedSopNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return SopType.AXES_HELPER; } initializeNode() { this.io.inputs.setCount(0); } cook(input_contents) { this._operation = this._operation || new AxesHelperSopOperation(this.scene(), this.states, this); const core_group = this._operation.cook(input_contents, this.pv); this.setCoreGroup(core_group); } }