UNPKG

@polygonjs/polygonjs

Version:

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

29 lines (28 loc) 937 B
"use strict"; import { TypedSopNode } from "./_Base"; import { SDFObject } from "../../../core/geometry/modules/sdf/SDFObject"; import { CoreGroup } from "../../../core/geometry/Group"; import { CoreObjectType } from "../../../core/geometry/ObjectContent"; import { ModuleName } from "../../poly/registers/modules/Common"; export class SDFSopNode extends TypedSopNode { dataType() { return CoreObjectType.SDF; } requiredModules() { return [ModuleName.SDF]; } setSDFGeometry(geometry) { const objects = [new SDFObject(geometry)]; this._setContainerSDFObjects(objects); } setSDFObjects(objects) { this._setContainerSDFObjects(objects); } _setContainerSDFObjects(objects) { const coreGroup = this.containerController.container().coreContent() || new CoreGroup(); coreGroup.setAllObjects(objects); this._setContainer(coreGroup); } } export class BaseSDFSopNodeClass extends SDFSopNode { }