polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
32 lines (31 loc) • 1.1 kB
JavaScript
import {TypedSopNode} from "./_Base";
import {IcosahedronSopOperation} from "../../../core/operations/sop/Icosahedron";
import {NodeParamsConfig, ParamConfig} from "../utils/params/ParamsConfig";
const DEFAULT = IcosahedronSopOperation.DEFAULT_PARAMS;
class IcosahedronSopParamsConfig extends NodeParamsConfig {
constructor() {
super(...arguments);
this.radius = ParamConfig.FLOAT(DEFAULT.radius);
this.detail = ParamConfig.INTEGER(DEFAULT.detail, {
range: [0, 10],
rangeLocked: [true, false]
});
this.pointsOnly = ParamConfig.BOOLEAN(DEFAULT.pointsOnly);
this.center = ParamConfig.VECTOR3(DEFAULT.center);
}
}
const ParamsConfig2 = new IcosahedronSopParamsConfig();
export class IcosahedronSopNode extends TypedSopNode {
constructor() {
super(...arguments);
this.params_config = ParamsConfig2;
}
static type() {
return "icosahedron";
}
cook() {
this._operation = this._operation || new IcosahedronSopOperation(this._scene, this.states);
const core_group = this._operation.cook([], this.pv);
this.setCoreGroup(core_group);
}
}