diff --git a/src/Aardvark.Base.FSharp/Math/Math.fs b/src/Aardvark.Base.FSharp/Math/Math.fs index 0f31464b..b5160dd9 100644 --- a/src/Aardvark.Base.FSharp/Math/Math.fs +++ b/src/Aardvark.Base.FSharp/Math/Math.fs @@ -779,6 +779,8 @@ module FSharpMath = let a : V2i = lerp V2i.Zero V2i.One 0.5f let a : V4i = lerp V4i.Zero V4i.One V4f.Half let a : C4b = lerp C4b.Black C4b.Black 0.5f + let a : C4b = lerp C4b.Black C4b.Black V4f.Half + let a : C4b = lerp C4b.Black C4b.Black V4d.Half () let invLerpWorking() = diff --git a/src/Aardvark.Base/Math/Colors/Color_auto.cs b/src/Aardvark.Base/Math/Colors/Color_auto.cs index 932eac0f..e73b7252 100644 --- a/src/Aardvark.Base/Math/Colors/Color_auto.cs +++ b/src/Aardvark.Base/Math/Colors/Color_auto.cs @@ -1587,11 +1587,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C3b LinearInterp(float t, C3b a, C3b b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3b LinearInterp(V3f t, C3b a, C3b b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3b LinearInterp(double t, C3b a, C3b b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3b LinearInterp(V3d t, C3b a, C3b b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3b DivideByInt(C3b c, int x) @@ -1758,18 +1768,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C3b Lerp(this float x, C3b a, C3b b) - { - return new C3b(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3b Lerp(this float t, C3b a, C3b b) + => new C3b(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); /// /// Returns the linearly interpolated color between a and b. /// - public static C3b Lerp(this double x, C3b a, C3b b) - { - return new C3b(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3b Lerp(this V3f t, C3b a, C3b b) + => new C3b(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3b Lerp(this double t, C3b a, C3b b) + => new C3b(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3b Lerp(this V3d t, C3b a, C3b b) + => new C3b(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); #endregion @@ -3863,11 +3881,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C3us LinearInterp(float t, C3us a, C3us b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3us LinearInterp(V3f t, C3us a, C3us b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3us LinearInterp(double t, C3us a, C3us b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3us LinearInterp(V3d t, C3us a, C3us b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3us DivideByInt(C3us c, int x) @@ -4034,18 +4062,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C3us Lerp(this float x, C3us a, C3us b) - { - return new C3us(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3us Lerp(this float t, C3us a, C3us b) + => new C3us(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); /// /// Returns the linearly interpolated color between a and b. /// - public static C3us Lerp(this double x, C3us a, C3us b) - { - return new C3us(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3us Lerp(this V3f t, C3us a, C3us b) + => new C3us(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3us Lerp(this double t, C3us a, C3us b) + => new C3us(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3us Lerp(this V3d t, C3us a, C3us b) + => new C3us(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); #endregion @@ -6062,11 +6098,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C3ui LinearInterp(float t, C3ui a, C3ui b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3ui LinearInterp(V3f t, C3ui a, C3ui b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3ui LinearInterp(double t, C3ui a, C3ui b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3ui LinearInterp(V3d t, C3ui a, C3ui b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3ui DivideByInt(C3ui c, int x) @@ -6233,18 +6279,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C3ui Lerp(this float x, C3ui a, C3ui b) - { - return new C3ui(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3ui Lerp(this float t, C3ui a, C3ui b) + => new C3ui(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); /// /// Returns the linearly interpolated color between a and b. /// - public static C3ui Lerp(this double x, C3ui a, C3ui b) - { - return new C3ui(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3ui Lerp(this V3f t, C3ui a, C3ui b) + => new C3ui(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3ui Lerp(this double t, C3ui a, C3ui b) + => new C3ui(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3ui Lerp(this V3d t, C3ui a, C3ui b) + => new C3ui(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); #endregion @@ -8136,6 +8190,11 @@ public readonly Text ToText(int bracketLevel = 1) public static C3f LinearInterp(float t, C3f a, C3f b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3f LinearInterp(V3f t, C3f a, C3f b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3f DivideByInt(C3f c, int x) @@ -8302,10 +8361,15 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C3f Lerp(this float x, C3f a, C3f b) - { - return new C3f(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3f Lerp(this float t, C3f a, C3f b) + => new C3f(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3f Lerp(this V3f t, C3f a, C3f b) + => new C3f(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); + #endregion #region ApproximateEquals @@ -10242,6 +10306,11 @@ public readonly Text ToText(int bracketLevel = 1) public static C3d LinearInterp(double t, C3d a, C3d b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C3d LinearInterp(V3d t, C3d a, C3d b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C3d DivideByInt(C3d c, int x) @@ -10408,10 +10477,15 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C3d Lerp(this double x, C3d a, C3d b) - { - return new C3d(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B)); - } + public static C3d Lerp(this double t, C3d a, C3d b) + => new C3d(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C3d Lerp(this V3d t, C3d a, C3d b) + => new C3d(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B)); + #endregion #region ApproximateEquals @@ -12869,11 +12943,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C4b LinearInterp(float t, C4b a, C4b b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4b LinearInterp(V4f t, C4b a, C4b b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4b LinearInterp(double t, C4b a, C4b b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4b LinearInterp(V4d t, C4b a, C4b b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4b DivideByInt(C4b c, int x) @@ -13050,18 +13134,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C4b Lerp(this float x, C4b a, C4b b) - { - return new C4b(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4b Lerp(this float t, C4b a, C4b b) + => new C4b(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); /// /// Returns the linearly interpolated color between a and b. /// - public static C4b Lerp(this double x, C4b a, C4b b) - { - return new C4b(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4b Lerp(this V4f t, C4b a, C4b b) + => new C4b(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4b Lerp(this double t, C4b a, C4b b) + => new C4b(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4b Lerp(this V4d t, C4b a, C4b b) + => new C4b(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); #endregion @@ -15428,11 +15520,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C4us LinearInterp(float t, C4us a, C4us b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4us LinearInterp(V4f t, C4us a, C4us b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4us LinearInterp(double t, C4us a, C4us b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4us LinearInterp(V4d t, C4us a, C4us b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4us DivideByInt(C4us c, int x) @@ -15610,18 +15712,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C4us Lerp(this float x, C4us a, C4us b) - { - return new C4us(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4us Lerp(this float t, C4us a, C4us b) + => new C4us(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); /// /// Returns the linearly interpolated color between a and b. /// - public static C4us Lerp(this double x, C4us a, C4us b) - { - return new C4us(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4us Lerp(this V4f t, C4us a, C4us b) + => new C4us(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4us Lerp(this double t, C4us a, C4us b) + => new C4us(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4us Lerp(this V4d t, C4us a, C4us b) + => new C4us(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); #endregion @@ -17893,11 +18003,21 @@ public readonly Text ToText(int bracketLevel = 1) public static C4ui LinearInterp(float t, C4ui a, C4ui b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4ui LinearInterp(V4f t, C4ui a, C4ui b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4ui LinearInterp(double t, C4ui a, C4ui b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4ui LinearInterp(V4d t, C4ui a, C4ui b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4ui DivideByInt(C4ui c, int x) @@ -18075,18 +18195,26 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C4ui Lerp(this float x, C4ui a, C4ui b) - { - return new C4ui(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4ui Lerp(this float t, C4ui a, C4ui b) + => new C4ui(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); /// /// Returns the linearly interpolated color between a and b. /// - public static C4ui Lerp(this double x, C4ui a, C4ui b) - { - return new C4ui(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4ui Lerp(this V4f t, C4ui a, C4ui b) + => new C4ui(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4ui Lerp(this double t, C4ui a, C4ui b) + => new C4ui(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4ui Lerp(this V4d t, C4ui a, C4ui b) + => new C4ui(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); #endregion @@ -20148,6 +20276,11 @@ public readonly Text ToText(int bracketLevel = 1) public static C4f LinearInterp(float t, C4f a, C4f b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4f LinearInterp(V4f t, C4f a, C4f b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4f DivideByInt(C4f c, int x) @@ -20325,10 +20458,15 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C4f Lerp(this float x, C4f a, C4f b) - { - return new C4f(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4f Lerp(this float t, C4f a, C4f b) + => new C4f(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4f Lerp(this V4f t, C4f a, C4f b) + => new C4f(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); + #endregion #region ApproximateEquals @@ -22438,6 +22576,11 @@ public readonly Text ToText(int bracketLevel = 1) public static C4d LinearInterp(double t, C4d a, C4d b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static C4d LinearInterp(V4d t, C4d a, C4d b) + => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static C4d DivideByInt(C4d c, int x) @@ -22615,10 +22758,15 @@ public static partial class Fun /// /// Returns the linearly interpolated color between a and b. /// - public static C4d Lerp(this double x, C4d a, C4d b) - { - return new C4d(Lerp(x, a.R, b.R), Lerp(x, a.G, b.G), Lerp(x, a.B, b.B), Lerp(x, a.A, b.A)); - } + public static C4d Lerp(this double t, C4d a, C4d b) + => new C4d(Lerp(t, a.R, b.R), Lerp(t, a.G, b.G), Lerp(t, a.B, b.B), Lerp(t, a.A, b.A)); + + /// + /// Returns the linearly interpolated color between a and b. + /// + public static C4d Lerp(this V4d t, C4d a, C4d b) + => new C4d(Lerp(t.X, a.R, b.R), Lerp(t.Y, a.G, b.G), Lerp(t.Z, a.B, b.B), Lerp(t.W, a.A, b.A)); + #endregion #region ApproximateEquals diff --git a/src/Aardvark.Base/Math/Colors/Color_template.cs b/src/Aardvark.Base/Math/Colors/Color_template.cs index 9939aaa5..a4bf293e 100644 --- a/src/Aardvark.Base/Math/Colors/Color_template.cs +++ b/src/Aardvark.Base/Math/Colors/Color_template.cs @@ -1124,11 +1124,17 @@ public readonly Text ToText(int bracketLevel = 1) //# foreach(var tt in fdtypes) { //# if (ft.IsReal && tt != ft) continue; + //# var vtt = Meta.VecTypeOf(dim, tt); [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static __type__ LinearInterp(__tt.Name__ t, __type__ a, __type__ b) => Fun.Lerp(t, a, b); + [EditorBrowsable(EditorBrowsableState.Never)] + [MethodImpl(MethodImplOptions.AggressiveInlining)] + public static __type__ LinearInterp(__vtt.Name__ t, __type__ a, __type__ b) + => Fun.Lerp(t, a, b); + //#} [EditorBrowsable(EditorBrowsableState.Never)] [MethodImpl(MethodImplOptions.AggressiveInlining)] @@ -1313,26 +1319,22 @@ public static partial class Fun { #region Interpolation - //# if (!fdtypes.Contains(ft)) { - //# fdtypes.ForEach(rt => { var rtype = rt.Name; + //# foreach(var tt in fdtypes) { + //# if (ft.IsReal && tt != ft) continue; + //# var vtt = Meta.VecTypeOf(dim, tt); /// /// Returns the linearly interpolated color between a and b. /// - public static __type__ Lerp(this __rtype__ x, __type__ a, __type__ b) - { - return new __type__(/*# fields.ForEach(f => {*/Lerp(x, a.__f__, b.__f__)/*#}, comma); */); - } + public static __type__ Lerp(this __tt.Name__ t, __type__ a, __type__ b) + => new __type__(/*# fields.ForEach(f => {*/Lerp(t, a.__f__, b.__f__)/*#}, comma); */); - //# }); - //# } else { /// /// Returns the linearly interpolated color between a and b. /// - public static __type__ Lerp(this __ftype__ x, __type__ a, __type__ b) - { - return new __type__(/*# fields.ForEach(f => {*/Lerp(x, a.__f__, b.__f__)/*#}, comma); */); - } - //# } + public static __type__ Lerp(this __vtt.Name__ t, __type__ a, __type__ b) + => new __type__(/*# fields.ForEach(Meta.VecFields, (cf, vf) => {*/Lerp(t.__vf__, a.__cf__, b.__cf__)/*#}, comma); */); + + //#} #endregion #region ApproximateEquals