UNPKG

@polygonjs/polygonjs

Version:

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

23 lines (22 loc) 690 B
"use strict"; import { BaseNodeGlMathFunctionArg1GlNode } from "./_BaseMathFunction"; import { GlConnectionPointType } from "../utils/io/connections/Gl"; export class LengthGlNode extends BaseNodeGlMathFunctionArg1GlNode { static type() { return "length"; } initializeNode() { super.initializeNode(); this.io.connection_points.set_input_name_function(this._gl_input_name.bind(this)); this.io.connection_points.set_expected_output_types_function(this._expected_output_types.bind(this)); } _gl_input_name(index) { return ["x"][index]; } gl_method_name() { return "length"; } _expected_output_types() { return [GlConnectionPointType.FLOAT]; } }