UNPKG

@polygonjs/polygonjs

Version:

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

30 lines (29 loc) 886 B
"use strict"; import { BaseNodeGlMathFunctionArg2GlNode } from "./_BaseMathFunction"; import MaxLength from "./gl/max_length.glsl"; import { FunctionGLDefinition } from "./utils/GLDefinition"; import { GlConnectionPointType } from "../utils/io/connections/Gl"; const MaxLengthDefaultValues = { max: 1 }; export class MaxLengthGlNode extends BaseNodeGlMathFunctionArg2GlNode { static type() { return "maxLength"; } _expected_input_types() { const type = this.io.connection_points.first_input_connection_type() || GlConnectionPointType.VEC3; return [type, GlConnectionPointType.FLOAT]; } _gl_input_name(index) { return ["val", "max"][index]; } paramDefaultValue(name) { return MaxLengthDefaultValues[name]; } gl_method_name() { return "maxLength"; } gl_function_definitions() { return [new FunctionGLDefinition(this, MaxLength)]; } }