@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
446 lines (445 loc) • 18.3 kB
JavaScript
;
import { ParamType } from "../../../../poly/ParamType";
import { BaseConnectionPoint } from "./_Base";
export var JsConnectionPointType = /* @__PURE__ */ ((JsConnectionPointType2) => {
JsConnectionPointType2["ANIMATION_MIXER"] = "AnimationMixer";
JsConnectionPointType2["ANIMATION_ACTION"] = "AnimationAction";
JsConnectionPointType2["BOOLEAN"] = "boolean";
JsConnectionPointType2["BOOLEAN_ARRAY"] = "boolean[]";
JsConnectionPointType2["BOX3"] = "Box3";
JsConnectionPointType2["CAMERA"] = "Camera";
JsConnectionPointType2["CATMULL_ROM_CURVE3"] = "CatmullRomCurve3";
JsConnectionPointType2["COLOR"] = "Color";
JsConnectionPointType2["COLOR_ARRAY"] = "Color[]";
JsConnectionPointType2["EULER"] = "Euler";
JsConnectionPointType2["EULER_ARRAY"] = "Euler[]";
JsConnectionPointType2["FLOAT"] = "float";
JsConnectionPointType2["FLOAT_ARRAY"] = "float[]";
JsConnectionPointType2["INT"] = "int";
JsConnectionPointType2["INT_ARRAY"] = "int[]";
JsConnectionPointType2["INTERSECTION"] = "Intersection";
JsConnectionPointType2["INTERSECTION_ARRAY"] = "Intersection[]";
JsConnectionPointType2["MATERIAL"] = "Material";
JsConnectionPointType2["MATRIX4"] = "Matrix4";
JsConnectionPointType2["MATRIX4_ARRAY"] = "Matrix4[]";
JsConnectionPointType2["NODE"] = "Node";
JsConnectionPointType2["OBJECT_3D"] = "Object3D";
JsConnectionPointType2["OBJECT_3D_ARRAY"] = "Object3D[]";
JsConnectionPointType2["PARAM"] = "Param";
JsConnectionPointType2["PLANE"] = "Plane";
JsConnectionPointType2["QUATERNION"] = "Quaternion";
JsConnectionPointType2["QUATERNION_ARRAY"] = "Quaternion[]";
JsConnectionPointType2["RAY"] = "Ray";
JsConnectionPointType2["SPHERE"] = "Sphere";
JsConnectionPointType2["STRING"] = "string";
JsConnectionPointType2["STRING_ARRAY"] = "string[]";
JsConnectionPointType2["TEXTURE"] = "Texture";
JsConnectionPointType2["TEXTURE_ARRAY"] = "Texture[]";
JsConnectionPointType2["TRIGGER"] = "trigger";
JsConnectionPointType2["VECTOR2"] = "Vector2";
JsConnectionPointType2["VECTOR2_ARRAY"] = "Vector2[]";
JsConnectionPointType2["VECTOR3"] = "Vector3";
JsConnectionPointType2["VECTOR3_ARRAY"] = "Vector3[]";
JsConnectionPointType2["VECTOR4"] = "Vector4";
JsConnectionPointType2["VECTOR4_ARRAY"] = "Vector4[]";
return JsConnectionPointType2;
})(JsConnectionPointType || {});
const NUMBER_JS_CONNECTION_TYPES = /* @__PURE__ */ new Set(["float" /* FLOAT */, "int" /* INT */]);
const PRIMITIVE_JS_CONNECTION_TYPES = /* @__PURE__ */ new Set([
"boolean" /* BOOLEAN */,
"float" /* FLOAT */,
"int" /* INT */,
"string" /* STRING */
]);
const VECTOR_JS_CONNECTION_TYPES = /* @__PURE__ */ new Set([
"Vector2" /* VECTOR2 */,
"Vector3" /* VECTOR3 */,
"Vector4" /* VECTOR4 */
]);
export const JS_CONNECTION_TYPES_FOR_CONSTANT = [
"boolean" /* BOOLEAN */,
"Color" /* COLOR */,
"float" /* FLOAT */,
"int" /* INT */,
"string" /* STRING */,
"Vector2" /* VECTOR2 */,
"Vector3" /* VECTOR3 */,
"Vector4" /* VECTOR4 */
];
export function isJsConnectionPointNumber(type) {
return NUMBER_JS_CONNECTION_TYPES.has(type);
}
export function isJsConnectionPointPrimitive(type) {
return PRIMITIVE_JS_CONNECTION_TYPES.has(type);
}
export function isJsConnectionPointVector(type) {
return VECTOR_JS_CONNECTION_TYPES.has(type);
}
export function isJsConnectionPointArray(type) {
return ARRAY_JS_CONNECTION_TYPES_SET.has(type);
}
export const JS_CONNECTION_POINT_TYPES = [
"AnimationMixer" /* ANIMATION_MIXER */,
"AnimationAction" /* ANIMATION_ACTION */,
"Box3" /* BOX3 */,
"boolean" /* BOOLEAN */,
"boolean[]" /* BOOLEAN_ARRAY */,
"Camera" /* CAMERA */,
"CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */,
"Color" /* COLOR */,
"Color[]" /* COLOR_ARRAY */,
"Euler" /* EULER */,
"Euler[]" /* EULER_ARRAY */,
"float" /* FLOAT */,
"float[]" /* FLOAT_ARRAY */,
"int" /* INT */,
"int[]" /* INT_ARRAY */,
"Intersection" /* INTERSECTION */,
"Intersection[]" /* INTERSECTION_ARRAY */,
"Material" /* MATERIAL */,
"Matrix4" /* MATRIX4 */,
"Matrix4[]" /* MATRIX4_ARRAY */,
"Node" /* NODE */,
"Object3D" /* OBJECT_3D */,
"Object3D[]" /* OBJECT_3D_ARRAY */,
"Param" /* PARAM */,
"Plane" /* PLANE */,
"Quaternion" /* QUATERNION */,
"Quaternion[]" /* QUATERNION_ARRAY */,
"Ray" /* RAY */,
"Sphere" /* SPHERE */,
"string" /* STRING */,
"string[]" /* STRING_ARRAY */,
"Texture" /* TEXTURE */,
"Texture[]" /* TEXTURE_ARRAY */,
"trigger" /* TRIGGER */,
"Vector2" /* VECTOR2 */,
"Vector2[]" /* VECTOR2_ARRAY */,
"Vector3" /* VECTOR3 */,
"Vector3[]" /* VECTOR3_ARRAY */,
"Vector4" /* VECTOR4 */,
"Vector4[]" /* VECTOR4_ARRAY */
// JsConnectionPointType.MAT3,
// JsConnectionPointType.MAT4,
];
export const JsConnectionPointTypeToArrayTypeMap = {
["AnimationMixer" /* ANIMATION_MIXER */]: "AnimationMixer" /* ANIMATION_MIXER */,
["AnimationAction" /* ANIMATION_ACTION */]: "AnimationAction" /* ANIMATION_ACTION */,
["boolean" /* BOOLEAN */]: "boolean[]" /* BOOLEAN_ARRAY */,
["boolean[]" /* BOOLEAN_ARRAY */]: "boolean[]" /* BOOLEAN_ARRAY */,
["Box3" /* BOX3 */]: "Box3" /* BOX3 */,
["Camera" /* CAMERA */]: "Camera" /* CAMERA */,
["CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */]: "CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */,
["Color" /* COLOR */]: "Color[]" /* COLOR_ARRAY */,
["Color[]" /* COLOR_ARRAY */]: "Color[]" /* COLOR_ARRAY */,
["Euler" /* EULER */]: "Euler[]" /* EULER_ARRAY */,
["Euler[]" /* EULER_ARRAY */]: "Euler[]" /* EULER_ARRAY */,
["float" /* FLOAT */]: "float[]" /* FLOAT_ARRAY */,
["float[]" /* FLOAT_ARRAY */]: "float[]" /* FLOAT_ARRAY */,
["int" /* INT */]: "int[]" /* INT_ARRAY */,
["int[]" /* INT_ARRAY */]: "int[]" /* INT_ARRAY */,
["Intersection" /* INTERSECTION */]: "Intersection[]" /* INTERSECTION_ARRAY */,
["Intersection[]" /* INTERSECTION_ARRAY */]: "Intersection[]" /* INTERSECTION_ARRAY */,
["Material" /* MATERIAL */]: "Material" /* MATERIAL */,
["Matrix4" /* MATRIX4 */]: "Matrix4[]" /* MATRIX4_ARRAY */,
["Matrix4[]" /* MATRIX4_ARRAY */]: "Matrix4[]" /* MATRIX4_ARRAY */,
["Node" /* NODE */]: "Node" /* NODE */,
["Object3D" /* OBJECT_3D */]: "Object3D[]" /* OBJECT_3D_ARRAY */,
["Object3D[]" /* OBJECT_3D_ARRAY */]: "Object3D[]" /* OBJECT_3D_ARRAY */,
["Param" /* PARAM */]: "Param" /* PARAM */,
["Plane" /* PLANE */]: "Plane" /* PLANE */,
["Quaternion" /* QUATERNION */]: "Quaternion[]" /* QUATERNION_ARRAY */,
["Quaternion[]" /* QUATERNION_ARRAY */]: "Quaternion[]" /* QUATERNION_ARRAY */,
["Ray" /* RAY */]: "Ray" /* RAY */,
["Sphere" /* SPHERE */]: "Sphere" /* SPHERE */,
//
["string" /* STRING */]: "string[]" /* STRING_ARRAY */,
["string[]" /* STRING_ARRAY */]: "string[]" /* STRING_ARRAY */,
["Texture" /* TEXTURE */]: "Texture[]" /* TEXTURE_ARRAY */,
["Texture[]" /* TEXTURE_ARRAY */]: "Texture[]" /* TEXTURE_ARRAY */,
// [ActorConnectionPointType.TRACKING_RESULT_HAND]: ActorConnectionPointType.TRACKING_RESULT_HAND,
["trigger" /* TRIGGER */]: "trigger" /* TRIGGER */,
["Vector2" /* VECTOR2 */]: "Vector2[]" /* VECTOR2_ARRAY */,
["Vector2[]" /* VECTOR2_ARRAY */]: "Vector2[]" /* VECTOR2_ARRAY */,
["Vector3" /* VECTOR3 */]: "Vector3[]" /* VECTOR3_ARRAY */,
["Vector3[]" /* VECTOR3_ARRAY */]: "Vector3[]" /* VECTOR3_ARRAY */,
["Vector4" /* VECTOR4 */]: "Vector4[]" /* VECTOR4_ARRAY */,
["Vector4[]" /* VECTOR4_ARRAY */]: "Vector4[]" /* VECTOR4_ARRAY */
};
export const JsConnectionPointTypeFromArrayTypeMap = {
["AnimationMixer" /* ANIMATION_MIXER */]: "AnimationMixer" /* ANIMATION_MIXER */,
["AnimationAction" /* ANIMATION_ACTION */]: "AnimationAction" /* ANIMATION_ACTION */,
["boolean" /* BOOLEAN */]: "boolean" /* BOOLEAN */,
["boolean[]" /* BOOLEAN_ARRAY */]: "boolean" /* BOOLEAN */,
["Box3" /* BOX3 */]: "Box3" /* BOX3 */,
["Camera" /* CAMERA */]: "Camera" /* CAMERA */,
["CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */]: "CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */,
["Color" /* COLOR */]: "Color" /* COLOR */,
["Color[]" /* COLOR_ARRAY */]: "Color" /* COLOR */,
["Euler" /* EULER */]: "Euler" /* EULER */,
["Euler[]" /* EULER_ARRAY */]: "Euler" /* EULER */,
["float" /* FLOAT */]: "float" /* FLOAT */,
["float[]" /* FLOAT_ARRAY */]: "float" /* FLOAT */,
["int" /* INT */]: "int" /* INT */,
["int[]" /* INT_ARRAY */]: "int" /* INT */,
["Intersection" /* INTERSECTION */]: "Intersection" /* INTERSECTION */,
["Intersection[]" /* INTERSECTION_ARRAY */]: "Intersection" /* INTERSECTION */,
["Material" /* MATERIAL */]: "Material" /* MATERIAL */,
["Matrix4" /* MATRIX4 */]: "Matrix4" /* MATRIX4 */,
["Matrix4[]" /* MATRIX4_ARRAY */]: "Matrix4" /* MATRIX4 */,
["Node" /* NODE */]: "Node" /* NODE */,
["Object3D" /* OBJECT_3D */]: "Object3D" /* OBJECT_3D */,
["Object3D[]" /* OBJECT_3D_ARRAY */]: "Object3D" /* OBJECT_3D */,
["Param" /* PARAM */]: "Param" /* PARAM */,
["Plane" /* PLANE */]: "Plane" /* PLANE */,
["Quaternion" /* QUATERNION */]: "Quaternion" /* QUATERNION */,
["Quaternion[]" /* QUATERNION_ARRAY */]: "Quaternion" /* QUATERNION */,
["Ray" /* RAY */]: "Ray" /* RAY */,
["Sphere" /* SPHERE */]: "Sphere" /* SPHERE */,
//
["string" /* STRING */]: "string" /* STRING */,
["string[]" /* STRING_ARRAY */]: "string" /* STRING */,
["Texture" /* TEXTURE */]: "Texture" /* TEXTURE */,
["Texture[]" /* TEXTURE_ARRAY */]: "Texture" /* TEXTURE */,
// [ActorConnectionPointType.TRACKING_RESULT_HAND]: ActorConnectionPointType.TRACKING_RESULT_HAND,
["trigger" /* TRIGGER */]: "trigger" /* TRIGGER */,
["Vector2" /* VECTOR2 */]: "Vector2" /* VECTOR2 */,
["Vector2[]" /* VECTOR2_ARRAY */]: "Vector2" /* VECTOR2 */,
["Vector3" /* VECTOR3 */]: "Vector3" /* VECTOR3 */,
["Vector3[]" /* VECTOR3_ARRAY */]: "Vector3" /* VECTOR3 */,
["Vector4" /* VECTOR4 */]: "Vector4" /* VECTOR4 */,
["Vector4[]" /* VECTOR4_ARRAY */]: "Vector4" /* VECTOR4 */
};
export const ARRAYABLE_CONNECTION_TYPES = /* @__PURE__ */ new Set([
"boolean" /* BOOLEAN */,
"Color" /* COLOR */,
"float" /* FLOAT */,
"int" /* INT */,
"Intersection" /* INTERSECTION */,
"Matrix4" /* MATRIX4 */,
"Quaternion" /* QUATERNION */,
"string" /* STRING */,
"Texture" /* TEXTURE */,
"Vector2" /* VECTOR2 */,
"Vector3" /* VECTOR3 */,
"Vector4" /* VECTOR4 */
]);
export const ARRAY_JS_CONNECTION_TYPES = [
"boolean[]" /* BOOLEAN_ARRAY */,
"Color[]" /* COLOR_ARRAY */,
"float[]" /* FLOAT_ARRAY */,
"int[]" /* INT_ARRAY */,
"Intersection[]" /* INTERSECTION_ARRAY */,
"Matrix4[]" /* MATRIX4_ARRAY */,
"Object3D[]" /* OBJECT_3D_ARRAY */,
"Quaternion[]" /* QUATERNION_ARRAY */,
"string[]" /* STRING_ARRAY */,
"Texture[]" /* TEXTURE_ARRAY */,
"Vector2[]" /* VECTOR2_ARRAY */,
"Vector3[]" /* VECTOR3_ARRAY */,
"Vector4[]" /* VECTOR4_ARRAY */
];
export const ARRAY_JS_CONNECTION_TYPES_SET = new Set(ARRAY_JS_CONNECTION_TYPES);
export const PARAM_CONVERTIBLE_JS_CONNECTION_POINT_TYPES = [
"boolean" /* BOOLEAN */,
"Color" /* COLOR */,
"float" /* FLOAT */,
"int" /* INT */,
"string" /* STRING */,
"Vector2" /* VECTOR2 */,
"Vector3" /* VECTOR3 */,
"Vector4" /* VECTOR4 */
];
export const POINT_ATTRIBUTE_JS_CONNECTION_POINT_TYPES = [
"Color" /* COLOR */,
"float" /* FLOAT */,
"int" /* INT */,
"Vector2" /* VECTOR2 */,
"Vector3" /* VECTOR3 */,
"Vector4" /* VECTOR4 */
];
export const JsConnectionPointTypeToParamTypeMap = {
["AnimationMixer" /* ANIMATION_MIXER */]: ParamType.BUTTON,
["AnimationAction" /* ANIMATION_ACTION */]: ParamType.BUTTON,
["boolean" /* BOOLEAN */]: ParamType.BOOLEAN,
["boolean[]" /* BOOLEAN_ARRAY */]: ParamType.BUTTON,
["Box3" /* BOX3 */]: ParamType.BUTTON,
["Camera" /* CAMERA */]: ParamType.BUTTON,
["CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */]: ParamType.BUTTON,
["Color" /* COLOR */]: ParamType.COLOR,
["Color[]" /* COLOR_ARRAY */]: ParamType.BUTTON,
["Euler" /* EULER */]: ParamType.BUTTON,
["Euler[]" /* EULER_ARRAY */]: ParamType.BUTTON,
["float" /* FLOAT */]: ParamType.FLOAT,
["float[]" /* FLOAT_ARRAY */]: ParamType.BUTTON,
["int" /* INT */]: ParamType.INTEGER,
["int[]" /* INT_ARRAY */]: ParamType.BUTTON,
["Intersection" /* INTERSECTION */]: ParamType.BUTTON,
["Intersection[]" /* INTERSECTION_ARRAY */]: ParamType.BUTTON,
["Material" /* MATERIAL */]: ParamType.BUTTON,
["Matrix4" /* MATRIX4 */]: ParamType.BUTTON,
["Matrix4[]" /* MATRIX4_ARRAY */]: ParamType.BUTTON,
["Node" /* NODE */]: ParamType.NODE_PATH,
["Object3D" /* OBJECT_3D */]: ParamType.BUTTON,
["Object3D[]" /* OBJECT_3D_ARRAY */]: ParamType.BUTTON,
["Param" /* PARAM */]: ParamType.PARAM_PATH,
["Plane" /* PLANE */]: ParamType.BUTTON,
["Quaternion" /* QUATERNION */]: ParamType.BUTTON,
["Quaternion[]" /* QUATERNION_ARRAY */]: ParamType.BUTTON,
["Ray" /* RAY */]: ParamType.BUTTON,
["Sphere" /* SPHERE */]: ParamType.BUTTON,
["string" /* STRING */]: ParamType.STRING,
["string[]" /* STRING_ARRAY */]: ParamType.BUTTON,
["Texture" /* TEXTURE */]: ParamType.BUTTON,
["Texture[]" /* TEXTURE_ARRAY */]: ParamType.BUTTON,
["trigger" /* TRIGGER */]: ParamType.BUTTON,
["Vector2" /* VECTOR2 */]: ParamType.VECTOR2,
["Vector2[]" /* VECTOR2_ARRAY */]: ParamType.BUTTON,
["Vector3" /* VECTOR3 */]: ParamType.VECTOR3,
["Vector3[]" /* VECTOR3_ARRAY */]: ParamType.BUTTON,
["Vector4" /* VECTOR4 */]: ParamType.VECTOR4,
["Vector4[]" /* VECTOR4_ARRAY */]: ParamType.BUTTON
// [JsConnectionPointType.MAT3]: undefined,
// [JsConnectionPointType.MAT4]: undefined,
};
export const JsParamTypeToConnectionPointTypeMap = {
[ParamType.BOOLEAN]: "boolean" /* BOOLEAN */,
[ParamType.COLOR]: "Color" /* COLOR */,
[ParamType.FLOAT]: "float" /* FLOAT */,
[ParamType.INTEGER]: "int" /* INT */,
[ParamType.FOLDER]: void 0,
[ParamType.VECTOR2]: "Vector2" /* VECTOR2 */,
[ParamType.VECTOR3]: "Vector3" /* VECTOR3 */,
[ParamType.VECTOR4]: "Vector4" /* VECTOR4 */,
[ParamType.BUTTON]: void 0,
[ParamType.NODE_PATH]: "Node" /* NODE */,
[ParamType.PARAM_PATH]: "Param" /* PARAM */,
[ParamType.RAMP]: void 0,
[ParamType.STRING]: "string" /* STRING */
};
export const JsConnectionPointInitValueMap = {
["AnimationAction" /* ANIMATION_ACTION */]: null,
["AnimationMixer" /* ANIMATION_MIXER */]: null,
["boolean" /* BOOLEAN */]: false,
["boolean[]" /* BOOLEAN_ARRAY */]: null,
["Box3" /* BOX3 */]: null,
["Camera" /* CAMERA */]: null,
["CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */]: null,
["Color" /* COLOR */]: [1, 1, 1],
["Color[]" /* COLOR_ARRAY */]: null,
["Euler" /* EULER */]: null,
["Euler[]" /* EULER_ARRAY */]: null,
["float" /* FLOAT */]: 0,
["float[]" /* FLOAT_ARRAY */]: null,
["int" /* INT */]: 0,
["int[]" /* INT_ARRAY */]: null,
["Intersection" /* INTERSECTION */]: null,
["Intersection[]" /* INTERSECTION_ARRAY */]: null,
["Material" /* MATERIAL */]: null,
["Matrix4" /* MATRIX4 */]: null,
["Matrix4[]" /* MATRIX4_ARRAY */]: null,
["Node" /* NODE */]: "",
["Object3D" /* OBJECT_3D */]: null,
["Object3D[]" /* OBJECT_3D_ARRAY */]: null,
["Param" /* PARAM */]: "",
["Plane" /* PLANE */]: null,
["Quaternion" /* QUATERNION */]: null,
["Quaternion[]" /* QUATERNION_ARRAY */]: null,
["Ray" /* RAY */]: null,
["Sphere" /* SPHERE */]: null,
["string" /* STRING */]: "",
["string[]" /* STRING_ARRAY */]: null,
["Texture" /* TEXTURE */]: null,
["Texture[]" /* TEXTURE_ARRAY */]: null,
["trigger" /* TRIGGER */]: null,
["Vector2" /* VECTOR2 */]: [0, 0],
["Vector2[]" /* VECTOR2_ARRAY */]: null,
["Vector3" /* VECTOR3 */]: [0, 0, 0],
["Vector3[]" /* VECTOR3_ARRAY */]: null,
["Vector4" /* VECTOR4 */]: [0, 0, 0, 0],
["Vector4[]" /* VECTOR4_ARRAY */]: null
// [JsConnectionPointType.MAT3]: [0],
// [JsConnectionPointType.MAT4]: [0],
};
export const JsConnectionPointComponentsCountMap = {
["AnimationAction" /* ANIMATION_ACTION */]: 1,
["AnimationMixer" /* ANIMATION_MIXER */]: 1,
["boolean" /* BOOLEAN */]: 1,
["boolean[]" /* BOOLEAN_ARRAY */]: 1,
["Box3" /* BOX3 */]: 1,
["Camera" /* CAMERA */]: 1,
["CatmullRomCurve3" /* CATMULL_ROM_CURVE3 */]: 1,
["Color" /* COLOR */]: 3,
["Color[]" /* COLOR_ARRAY */]: 1,
["Euler" /* EULER */]: 3,
["Euler[]" /* EULER_ARRAY */]: 1,
["float" /* FLOAT */]: 1,
["float[]" /* FLOAT_ARRAY */]: 1,
["int" /* INT */]: 1,
["int[]" /* INT_ARRAY */]: 1,
["Intersection" /* INTERSECTION */]: 1,
["Intersection[]" /* INTERSECTION_ARRAY */]: 1,
["Material" /* MATERIAL */]: 1,
["Matrix4" /* MATRIX4 */]: 1,
["Matrix4[]" /* MATRIX4_ARRAY */]: 1,
["Node" /* NODE */]: 1,
["Object3D" /* OBJECT_3D */]: 1,
["Object3D[]" /* OBJECT_3D_ARRAY */]: 1,
["Param" /* PARAM */]: 1,
["Plane" /* PLANE */]: 1,
["Quaternion" /* QUATERNION */]: 1,
["Quaternion[]" /* QUATERNION_ARRAY */]: 1,
["Ray" /* RAY */]: 1,
["Sphere" /* SPHERE */]: 1,
["string" /* STRING */]: 1,
["string[]" /* STRING_ARRAY */]: 1,
["Texture" /* TEXTURE */]: 1,
["Texture[]" /* TEXTURE_ARRAY */]: 1,
["trigger" /* TRIGGER */]: 1,
["Vector2" /* VECTOR2 */]: 2,
["Vector2[]" /* VECTOR2_ARRAY */]: 1,
["Vector3" /* VECTOR3 */]: 3,
["Vector3[]" /* VECTOR3_ARRAY */]: 1,
["Vector4" /* VECTOR4 */]: 4,
["Vector4[]" /* VECTOR4_ARRAY */]: 1
};
export const JS_CONNECTION_POINT_IN_NODE_DEF = {
inNodeDefinition: true
};
export class JsConnectionPoint extends BaseConnectionPoint {
constructor(_name, _type, _options) {
super(_name, _type);
this._type = _type;
this._options = _options;
this._isArray = ARRAY_JS_CONNECTION_TYPES_SET.has(_type);
this._init_value = JsConnectionPointInitValueMap[this._type];
if (_options) {
this._inNodeDefinition = _options.inNodeDefinition == true;
if (_options.init_value != null) {
this._init_value = _options.init_value;
}
}
}
type() {
return this._type;
}
are_types_matched(src_type, dest_type) {
return src_type == dest_type;
}
get param_type() {
return JsConnectionPointTypeToParamTypeMap[this._type];
}
get init_value() {
return this._init_value;
}
toJSON() {
return this._json = this._json || this._createJSON();
}
_createJSON() {
return {
name: this._name,
type: this._type,
isArray: this._isArray
};
}
}