Skip to content

Commit e6ca30b

Browse files
committed
renamed normal() to linstep() to avoid confusion
1 parent bbb100e commit e6ca30b

File tree

1 file changed

+33
-45
lines changed

1 file changed

+33
-45
lines changed

Runtime/mathx.interpolation.common.cs

Lines changed: 33 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -200,28 +200,28 @@ public static partial class mathx
200200
[MethodImpl(IL)] public static float arc(this float x) => abs(sine01(x));
201201
#endregion
202202

203-
#region normal
203+
#region linstep
204204
/// <summary> Remaps a value from a min to max to tih </summary>
205-
[MethodImpl(IL)] public static float4 normal(float4 value, float4 zero, float4 one) => saturate(value.unlerp(zero, one));
206-
/// <inheritdoc cref="normal(float4, float4, float4)" />
207-
[MethodImpl(IL)] public static float4 normal(float4 value, float4 zero, float one) => saturate(value.unlerp(zero, one));
208-
/// <inheritdoc cref="normal(float4, float4, float4)" />
209-
[MethodImpl(IL)] public static float3 normal(float3 value, float3 zero, float3 one) => saturate(value.unlerp(zero, one));
210-
/// <inheritdoc cref="normal(float4, float4, float4)" />
211-
[MethodImpl(IL)] public static float3 normal(float3 value, float3 zero, float one) => saturate(value.unlerp(zero, one));
212-
/// <inheritdoc cref="normal(float4, float4, float4)" />
213-
[MethodImpl(IL)] public static float2 normal(float2 value, float2 zero, float2 one) => saturate(value.unlerp(zero, one));
214-
/// <inheritdoc cref="normal(float4, float4, float4)" />
215-
[MethodImpl(IL)] public static float2 normal(float2 value, float2 zero, float one) => saturate(value.unlerp(zero, one));
216-
/// <inheritdoc cref="normal(float4, float4, float4)" />
217-
[MethodImpl(IL)] public static float2 normal(float2 value, float zero, float2 one) => saturate(value.unlerp(zero, one));
218-
/// <inheritdoc cref="normal(float4, float4, float4)" />
219-
[MethodImpl(IL)] public static float2 normal(float2 value, float zero, float one) => saturate(value.unlerp(zero, one));
220-
/// <inheritdoc cref="normal(float4, float4, float4)" />
221-
[MethodImpl(IL)] public static float normal(float value, float zero, float one) => saturate(zero.unlerp(one, value));
205+
[MethodImpl(IL)] public static float4 linstep(float4 value, float4 zero, float4 one) => saturate(value.unlerp(zero, one));
206+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
207+
[MethodImpl(IL)] public static float4 linstep(float4 value, float4 zero, float one) => saturate(value.unlerp(zero, one));
208+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
209+
[MethodImpl(IL)] public static float3 linstep(float3 value, float3 zero, float3 one) => saturate(value.unlerp(zero, one));
210+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
211+
[MethodImpl(IL)] public static float3 linstep(float3 value, float3 zero, float one) => saturate(value.unlerp(zero, one));
212+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
213+
[MethodImpl(IL)] public static float2 linstep(float2 value, float2 zero, float2 one) => saturate(value.unlerp(zero, one));
214+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
215+
[MethodImpl(IL)] public static float2 linstep(float2 value, float2 zero, float one) => saturate(value.unlerp(zero, one));
216+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
217+
[MethodImpl(IL)] public static float2 linstep(float2 value, float zero, float2 one) => saturate(value.unlerp(zero, one));
218+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
219+
[MethodImpl(IL)] public static float2 linstep(float2 value, float zero, float one) => saturate(value.unlerp(zero, one));
220+
/// <inheritdoc cref="linstep(float4,float4,float4)" />
221+
[MethodImpl(IL)] public static float linstep(float value, float zero, float one) => saturate(zero.unlerp(one, value));
222222
#endregion
223223

224-
#region sine
224+
#region sine01
225225
/// <summary> Returns the sin of x multiplied by PI. </summary>
226226
[MethodImpl(IL)] public static float4 sine01(float4 x) => sin(x*PI);
227227
/// <inheritdoc cref="sine01(float4)" />
@@ -407,32 +407,20 @@ public static partial class mathx
407407
public static float4 smin_N_factor(this float4 t, float4 a, float4 b, float4 n, out float4 factor) => f4(t.x.smin_N_factor(a.x, b.x, n.x, out factor.x), t.y.smin_N_factor(a.y, b.y, n.y, out factor.y), t.z.smin_N_factor(a.z, b.z, n.z, out factor.z), t.w.smin_N_factor(a.w, b.w, n.w, out factor.w));
408408

409409
#region mix
410-
// <summary>Returns (1-weightB)*a + weightB*b.</summary>
411-
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float4 weightB, float4 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
412-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
413-
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float4 weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
414-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
415-
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float weightB, float4 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
416-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
417-
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
418-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
419-
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float3 weightB, float3 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
420-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
421-
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float3 weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
422-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
423-
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float weightB, float3 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
424-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
425-
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
426-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
427-
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float2 weightB, float2 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
428-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
429-
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float2 weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
430-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
431-
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float weightB, float2 t) => math.mad(weightB,b,math.mad(-weightB,a,a));
432-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
433-
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
434-
/// <inheritdoc cref="mix(float4,float4,float4,float4)" />
435-
[MethodImpl(IL)] public static float mix(float a, float b, float weightB, float t) => math.mad(weightB,b,math.mad(-weightB,a,a));
410+
// <summary>Returns (1-t)*a + t*b.</summary>
411+
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float4 t) => math.mad(t,b,math.mad(-t,a,a));
412+
/// <inheritdoc cref="mix(float4,float4,float4)" />
413+
[MethodImpl(IL)] public static float4 mix(float4 a, float4 b, float t) => math.mad(t,b,math.mad(-t,a,a));
414+
/// <inheritdoc cref="mix(float4,float4,float4)" />
415+
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float3 t) => math.mad(t,b,math.mad(-t,a,a));
416+
/// <inheritdoc cref="mix(float4,float4,float4)" />
417+
[MethodImpl(IL)] public static float3 mix(float3 a, float3 b, float t) => math.mad(t,b,math.mad(-t,a,a));
418+
/// <inheritdoc cref="mix(float4,float4,float4)" />
419+
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float2 t) => math.mad(t,b,math.mad(-t,a,a));
420+
/// <inheritdoc cref="mix(float4,float4,float4)" />
421+
[MethodImpl(IL)] public static float2 mix(float2 a, float2 b, float t) => math.mad(t,b,math.mad(-t,a,a));
422+
/// <inheritdoc cref="mix(float4,float4,float4)" />
423+
[MethodImpl(IL)] public static float mix(float a, float b, float t) => math.mad(t,b,math.mad(-t,a,a));
436424
#endregion
437425

438426
#region smoothstart

0 commit comments

Comments
 (0)