@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
61 lines (60 loc) • 1.74 kB
JavaScript
;
import { ParamLessBaseNetworkRopNode } from "./_BaseManager";
import { NodeContext, NetworkNodeType } from "../../poly/NodeContext";
import { ActorPersistedConfig } from "../js/code/assemblers/actor/ActorPersistedConfig";
import { AssemblerName } from "../../poly/registers/assemblers/_BaseRegister";
import { ActorCompilationController } from "../../../core/actor/ActorCompilationController";
import { Poly } from "../../Poly";
export class ActorsNetworkRopNode extends ParamLessBaseNetworkRopNode {
constructor() {
super(...arguments);
this._childrenControllerContext = NodeContext.JS;
//
// ASSEMBLERS
//
this.persisted_config = new ActorPersistedConfig(this);
this._assemblerController = this._createAssemblerController();
//
// compilation
//
this.compilationController = new ActorCompilationController(this);
}
static type() {
return NetworkNodeType.ACTOR;
}
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();
}
cook() {
this.compilationController.compileIfRequired();
this.cookController.endCook();
}
}