Skip to content

Commit 8836132

Browse files
committed
reordered methods
1 parent e6ca30b commit 8836132

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

Runtime/mathx.interpolation.common.cs

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,6 @@ public static partial class mathx
161161
return a + num * x.sat();
162162
}
163163

164-
// Remap --------------------------------------------------------------------
165164
/// Remapping function identical as in HLSL
166165
[MethodImpl(IL)] public static float4 remap(this float t, float4 oldMin, float4 oldMax, float4 newMin, float4 newMax) => math.remap(oldMin, oldMax, newMin, newMax, t);
167166
/// <inheritdoc cref="remap(float,float,float,float,float)" />
@@ -171,7 +170,6 @@ public static partial class mathx
171170
/// <inheritdoc cref="remap(float,float,float,float,float)" />
172171
[MethodImpl(IL)] public static float remap(this float t, float oldMin, float oldMax, float newMin, float newMax) => math.remap(oldMin, oldMax, newMin, newMax, t);
173172

174-
// step ---------------------------------------------------------------------
175173
/// <inheritdoc cref="math.step(float, float)" />
176174
[MethodImpl(IL)] public static float step(this float f, float step) => math.step(f, step);
177175
/// <inheritdoc cref="step(float,float)" />
@@ -190,6 +188,7 @@ public static partial class mathx
190188
[MethodImpl(IL)] public static double2 step(this double2 f, double2 step) => math.step(f, step);
191189

192190
#region arc
191+
193192
/// <summary> Returns the absolute version of sin(x) </summary>
194193
[MethodImpl(IL)] public static float4 arc(this float4 x) => abs(sine01(x));
195194
/// <inheritdoc cref="arc(float4)" />
@@ -198,9 +197,24 @@ public static partial class mathx
198197
[MethodImpl(IL)] public static float2 arc(this float2 x) => abs(sine01(x));
199198
/// <inheritdoc cref="arc(float4)" />
200199
[MethodImpl(IL)] public static float arc(this float x) => abs(sine01(x));
200+
201+
#endregion
202+
203+
#region arch2
204+
205+
/// <summary> Returns x multiplied by inv(x) </summary>
206+
[MethodImpl(IL)] public static float4 arch2(float4 x) => x * inv(x);
207+
/// <inheritdoc cref="arch2(float4)" />
208+
[MethodImpl(IL)] public static float3 arch2(float3 x) => x * inv(x);
209+
/// <inheritdoc cref="arch2(float4)" />
210+
[MethodImpl(IL)] public static float2 arch2(float2 x) => x * inv(x);
211+
/// <inheritdoc cref="arch2(float4)" />
212+
[MethodImpl(IL)] public static float arch2(float x) => x * inv(x);
213+
201214
#endregion
202215

203216
#region linstep
217+
204218
/// <summary> Remaps a value from a min to max to tih </summary>
205219
[MethodImpl(IL)] public static float4 linstep(float4 value, float4 zero, float4 one) => saturate(value.unlerp(zero, one));
206220
/// <inheritdoc cref="linstep(float4,float4,float4)" />
@@ -219,9 +233,11 @@ public static partial class mathx
219233
[MethodImpl(IL)] public static float2 linstep(float2 value, float zero, float one) => saturate(value.unlerp(zero, one));
220234
/// <inheritdoc cref="linstep(float4,float4,float4)" />
221235
[MethodImpl(IL)] public static float linstep(float value, float zero, float one) => saturate(zero.unlerp(one, value));
236+
222237
#endregion
223238

224239
#region sine01
240+
225241
/// <summary> Returns the sin of x multiplied by PI. </summary>
226242
[MethodImpl(IL)] public static float4 sine01(float4 x) => sin(x*PI);
227243
/// <inheritdoc cref="sine01(float4)" />
@@ -230,20 +246,10 @@ public static partial class mathx
230246
[MethodImpl(IL)] public static float2 sine01(float2 x) => sin(x*PI);
231247
/// <inheritdoc cref="sine01(float4)" />
232248
[MethodImpl(IL)] public static float sine01(float x) => sin(x*PI);
249+
233250
#endregion
234251

235-
#region arch2
236-
/// <summary> Returns x multiplied by inv(x) </summary>
237-
[MethodImpl(IL)] public static float4 arch2(float4 x) => x * inv(x);
238-
/// <inheritdoc cref="arch2(float4)" />
239-
[MethodImpl(IL)] public static float3 arch2(float3 x) => x * inv(x);
240-
/// <inheritdoc cref="arch2(float4)" />
241-
[MethodImpl(IL)] public static float2 arch2(float2 x) => x * inv(x);
242-
/// <inheritdoc cref="arch2(float4)" />
243-
[MethodImpl(IL)] public static float arch2(float x) => x * inv(x);
244-
#endregion
245-
246-
252+
247253
#region Smooth Min
248254

249255
/// Smooth min is a smooth version of math.min() that accepts a smoothness parameter t

0 commit comments

Comments
 (0)