UNPKG

@polygonjs/polygonjs

Version:

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

65 lines (64 loc) 1.77 kB
"use strict"; import { TypedSopNode } from "./_Base"; import { NodeContext } from "../../poly/NodeContext"; import { AssemblerName } from "../../poly/registers/assemblers/_BaseRegister"; import { Poly } from "../../Poly"; import { ActorPersistedConfig } from "../js/code/assemblers/actor/ActorPersistedConfig"; import { ActorCompilationController } from "../../../core/actor/ActorCompilationController"; export class TypedActorSopNode extends TypedSopNode { constructor() { super(...arguments); // // CHILDREN // this._childrenControllerContext = NodeContext.JS; // // ASSEMBLERS // this.persisted_config = new ActorPersistedConfig(this); this._assemblerController = this._createAssemblerController(); // // compilation // this.compilationController = new ActorCompilationController(this); } createNode(node_class, options) { return super.createNode(node_class, options); } children() { return super.children(); } nodesByType(type) { return super.nodesByType(type); } childrenAllowed() { if (this.assemblerController()) { return super.childrenAllowed(); } return false; } sceneReadonly() { return this.assemblerController() == null; } assemblerController() { return this._assemblerController; } usedAssembler() { return AssemblerName.JS_ACTOR; } _createAssemblerController() { return Poly.assemblersRegister.assembler(this, this.usedAssembler()); } compile() { this.compilationController.compile(); } functionData() { return this.compilationController.functionData(); } // // clean // updateObjectOnRemove(object, parent) { this.compilationController.evaluatorGenerator().disposeEvaluator(object); } }