UNPKG

@polygonjs/polygonjs

Version:

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

35 lines (34 loc) 1.19 kB
"use strict"; import { TypedJsNode } from "./_Base"; import { NodeParamsConfig } from "../utils/params/ParamsConfig"; import { JsConnectionPoint, JsConnectionPointType } from "../utils/io/connections/Js"; import { Poly } from "../../Poly"; class GetDefaultCameraJsParamsConfig extends NodeParamsConfig { } const ParamsConfig = new GetDefaultCameraJsParamsConfig(); export class GetDefaultCameraJsNode extends TypedJsNode { constructor() { super(...arguments); this.paramsConfig = ParamsConfig; } static type() { return "getDefaultCamera"; } initializeNode() { this.io.inputs.setNamedInputConnectionPoints([]); this.io.outputs.setNamedOutputConnectionPoints([ new JsConnectionPoint(JsConnectionPointType.CAMERA, JsConnectionPointType.CAMERA) ]); } setLines(shadersCollectionController) { const varName = this.jsVarName(JsConnectionPointType.CAMERA); const func = Poly.namedFunctionsRegister.getFunction("getDefaultCamera", this, shadersCollectionController); shadersCollectionController.addBodyOrComputed(this, [ { dataType: JsConnectionPointType.CAMERA, varName, value: func.asString() } ]); } }