UNPKG

@polygonjs/polygonjs

Version:

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

35 lines (34 loc) 717 B
"use strict"; import { NamedFunction, NamedFunction2 } from "./_Base"; export class addNumber extends NamedFunction { static type() { return "addNumber"; } func(...args) { let first = args[0]; for (let i = 1; i < args.length; i++) { first += args[i]; } return first; } } export class addVector extends NamedFunction { static type() { return "addVector"; } func(...args) { const first = args[0]; for (let i = 1; i < args.length; i++) { first.add(args[i]); } return first; } } export class addVectorNumber extends NamedFunction2 { static type() { return "addVectorNumber"; } func(vector, number) { return vector.addScalar(number); } }