UNPKG

@polygonjs/polygonjs

Version:

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

52 lines (51 loc) 1.17 kB
"use strict"; import { mix } from "../../core/math/_Module"; import { NamedFunction3, NamedFunction4 } from "./_Base"; export class lerpNumber extends NamedFunction3 { static type() { return "lerpNumber"; } func(v1, v2, lerp) { return mix(v1, v2, lerp); } } export class lerpColor extends NamedFunction4 { static type() { return "lerpColor"; } func(v1, v2, lerp, target) { return target.copy(v1).lerp(v2, lerp); } } export class lerpQuaternion extends NamedFunction4 { static type() { return "lerpQuaternion"; } func(v1, v2, lerp, target) { return target.copy(v1).slerp(v2, lerp); } } export class lerpVector2 extends NamedFunction4 { static type() { return "lerpVector2"; } func(v1, v2, lerp, target) { return target.copy(v1).lerp(v2, lerp); } } export class lerpVector3 extends NamedFunction4 { static type() { return "lerpVector3"; } func(v1, v2, lerp, target) { return target.copy(v1).lerp(v2, lerp); } } export class lerpVector4 extends NamedFunction4 { static type() { return "lerpVector4"; } func(v1, v2, lerp, target) { return target.copy(v1).lerp(v2, lerp); } }