polygonjs-engine
Version:
node-based webgl 3D engine https://polygonjs.com
58 lines (57 loc) • 1.56 kB
JavaScript
import {NodeContext as NodeContext2} 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 = {
[]: void 0,
[]: void 0,
[]: EventConnectionPointType.BASE,
[]: GlConnectionPointType.FLOAT,
[]: JsConnectionPointType.FLOAT,
[]: void 0,
[]: void 0,
[]: void 0,
[]: void 0,
[]: void 0,
[]: void 0
};
export function create_connection_point(context, name, type) {
switch (context) {
case NodeContext2.EVENT: {
return new EventConnectionPoint(name, type);
}
case NodeContext2.GL: {
return new GlConnectionPoint(name, type);
}
case NodeContext2.JS: {
return new JsConnectionPoint(name, type);
}
default: {
return void 0;
}
}
}
export function param_type_to_connection_point_type_map(context) {
switch (context) {
case NodeContext2.EVENT: {
return void 0;
}
case NodeContext2.GL: {
return GLParamTypeToConnectionPointTypeMap;
}
case NodeContext2.JS: {
return JsParamTypeToConnectionPointTypeMap;
}
default: {
return void 0;
}
}
}