UNPKG

@polygonjs/polygonjs

Version:

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

26 lines (25 loc) 686 B
"use strict"; import Quaternion from "./gl/quaternion.glsl"; import { MathFunctionArg3Factory } from "./_Math_Arg3"; import { GlConnectionPointType } from "../utils/io/connections/Gl"; const DefaultValues = { start: [0, 0, 1], end: [1, 0, 0], up: [0, 1, 0] }; export class VectorAlignGlNode extends MathFunctionArg3Factory("vectorAlign", { in: ["start", "end", "up"], method: "vectorAlignWithUp", functions: [Quaternion] }) { _expected_input_types() { const type = GlConnectionPointType.VEC3; return [type, type, type]; } _expected_output_types() { return [GlConnectionPointType.VEC4]; } paramDefaultValue(name) { return DefaultValues[name]; } }