UNPKG

@polygonjs/polygonjs

Version:

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

62 lines (61 loc) 1.64 kB
"use strict"; import { NodeContext } from "../../../../poly/NodeContext"; import { GlConnectionPointType, GlConnectionPoint, GLParamTypeToConnectionPointTypeMap } from "./Gl"; import { JsConnectionPointType, JsConnectionPoint, JsParamTypeToConnectionPointTypeMap } from "./Js"; import { EventConnectionPoint, EventConnectionPointType } from "./Event"; export const DEFAULT_CONNECTION_POINT_ENUM_MAP = { [NodeContext.ANIM]: void 0, [NodeContext.AUDIO]: void 0, // [NodeContext.CAD]: undefined, [NodeContext.COP]: void 0, // [NodeContext.CSG]: undefined, [NodeContext.EVENT]: EventConnectionPointType.BASE, [NodeContext.GL]: GlConnectionPointType.FLOAT, [NodeContext.JS]: JsConnectionPointType.FLOAT, [NodeContext.MANAGER]: void 0, [NodeContext.MAT]: void 0, [NodeContext.OBJ]: void 0, [NodeContext.POST]: void 0, [NodeContext.ROP]: void 0, [NodeContext.SOP]: void 0 }; export function createConnectionPoint(context, name, type) { switch (context) { case NodeContext.EVENT: { return new EventConnectionPoint(name, type); } case NodeContext.GL: { return new GlConnectionPoint(name, type); } case NodeContext.JS: { return new JsConnectionPoint(name, type); } default: { return void 0; } } } export function paramTypeToConnectionPointTypeMap(context) { switch (context) { case NodeContext.EVENT: { return void 0; } case NodeContext.GL: { return GLParamTypeToConnectionPointTypeMap; } case NodeContext.JS: { return JsParamTypeToConnectionPointTypeMap; } default: { return void 0; } } }