@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
84 lines (83 loc) • 3.81 kB
TypeScript
import { ParamInitValuesTypeMap } from '../../../../params/types/ParamInitValuesTypeMap';
import { ParamType } from '../../../../poly/ParamType';
export declare enum GlConnectionPointType {
BOOL = "bool",
INT = "int",
FLOAT = "float",
MAT3 = "mat3",
MAT4 = "mat4",
VEC2 = "vec2",
VEC3 = "vec3",
VEC4 = "vec4",
SAMPLER_2D = "sampler2D",
SAMPLER_2D_ARRAY = "sampler2DArray",
SAMPLER_3D = "sampler3D",
SAMPLER_CUBE = "samplerCube",
SSS_MODEL = "SSSModel",
SDF_CONTEXT = "SDFContext",
SDF_MATERIAL = "SDFMaterial"
}
export declare const GL_CONNECTION_POINT_TYPES: Array<GlConnectionPointType>;
export declare const GL_CONNECTION_POINT_TYPES_FOR_CONSTANT: Array<GlConnectionPointType>;
type GlConnectionPointTypeToParamTypeMapGeneric = {
[key in GlConnectionPointType]: ParamType;
};
export interface GlIConnectionPointTypeToParamTypeMap extends GlConnectionPointTypeToParamTypeMapGeneric {
[GlConnectionPointType.BOOL]: ParamType.BOOLEAN;
[GlConnectionPointType.INT]: ParamType.INTEGER;
[GlConnectionPointType.FLOAT]: ParamType.FLOAT;
[GlConnectionPointType.VEC2]: ParamType.VECTOR2;
[GlConnectionPointType.VEC3]: ParamType.VECTOR3;
[GlConnectionPointType.VEC4]: ParamType.VECTOR4;
[GlConnectionPointType.MAT3]: ParamType.BUTTON;
[GlConnectionPointType.MAT4]: ParamType.BUTTON;
}
export declare const GlConnectionPointTypeToParamTypeMap: GlIConnectionPointTypeToParamTypeMap;
type GLParamTypeToConnectionPointTypeMapGeneric = {
[key in ParamType]: GlConnectionPointType | undefined;
};
export interface IGLParamTypeToConnectionPointTypeMap extends GLParamTypeToConnectionPointTypeMapGeneric {
[ParamType.BOOLEAN]: GlConnectionPointType.BOOL;
[ParamType.COLOR]: GlConnectionPointType.VEC3;
[ParamType.INTEGER]: GlConnectionPointType.INT;
[ParamType.FLOAT]: GlConnectionPointType.FLOAT;
[ParamType.FOLDER]: undefined;
[ParamType.VECTOR2]: GlConnectionPointType.VEC2;
[ParamType.VECTOR3]: GlConnectionPointType.VEC3;
[ParamType.VECTOR4]: GlConnectionPointType.VEC4;
[ParamType.BUTTON]: undefined;
[ParamType.NODE_PATH]: undefined;
[ParamType.PARAM_PATH]: undefined;
[ParamType.RAMP]: undefined;
[ParamType.STRING]: undefined;
}
export declare const GLParamTypeToConnectionPointTypeMap: IGLParamTypeToConnectionPointTypeMap;
export type GlConnectionPointInitValueMapGeneric = {
[key in GlConnectionPointType]: ParamInitValuesTypeMap[GlIConnectionPointTypeToParamTypeMap[key]];
};
export declare const GlConnectionPointInitValueMap: GlConnectionPointInitValueMapGeneric;
export type ConnectionPointComponentsCountMapGeneric = {
[key in GlConnectionPointType]: number;
};
export declare const GlConnectionPointComponentsCountMap: ConnectionPointComponentsCountMapGeneric;
export interface GlConnectionPointData<T extends GlConnectionPointType> {
name: string;
type: T;
isArray?: boolean;
}
import { BaseConnectionPoint } from './_Base';
export declare class GlConnectionPoint<T extends GlConnectionPointType> extends BaseConnectionPoint {
protected _name: string;
protected _type: T;
protected _init_value?: GlConnectionPointInitValueMapGeneric[T] | undefined;
protected _json: GlConnectionPointData<T> | undefined;
constructor(_name: string, _type: T, _init_value?: GlConnectionPointInitValueMapGeneric[T] | undefined);
type(): T;
are_types_matched(src_type: string, dest_type: string): boolean;
get param_type(): GlIConnectionPointTypeToParamTypeMap[T];
get init_value(): GlConnectionPointInitValueMapGeneric[T] | undefined;
toJSON(): GlConnectionPointData<T>;
protected _createJSON(): GlConnectionPointData<T>;
}
export type BaseGlConnectionPoint = GlConnectionPoint<GlConnectionPointType>;
export {};