@polygonjs/polygonjs
Version:
node-based WebGL 3D engine https://polygonjs.com
25 lines (24 loc) • 652 B
JavaScript
;
import Quaternion from "./gl/quaternion.glsl";
import { MathFunctionArg2Factory } from "./_Math_Arg2";
import { GlConnectionPointType } from "../utils/io/connections/Gl";
const DefaultValues = {
start: [0, 0, 1],
end: [1, 0, 0]
};
export class VectorAngleGlNode extends MathFunctionArg2Factory("vectorAngle", {
in: ["start", "end"],
method: "vectorAngle",
functions: [Quaternion]
}) {
_expected_input_types() {
const type = GlConnectionPointType.VEC3;
return [type, type];
}
_expected_output_types() {
return [GlConnectionPointType.FLOAT];
}
paramDefaultValue(name) {
return DefaultValues[name];
}
}