Skip to content

Commit

Permalink
Revert "[Math] System.Numerics conversions (#1161)" (#1167)
Browse files Browse the repository at this point in the history
building for UWP, iOS and Android is broken, will merge back once a proper fix has been found
  • Loading branch information
Eideren authored Oct 18, 2021
1 parent 0fd8f8d commit 6b02070
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 168 deletions.
12 changes: 0 additions & 12 deletions sources/core/Stride.Core.Mathematics/Double2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,18 +141,6 @@ public double this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Double2(System.Numerics.Vector2 v) => new(v.X,v.Y);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector2(Double2 v) => new((float)v.X, (float)v.Y);

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
13 changes: 0 additions & 13 deletions sources/core/Stride.Core.Mathematics/Double3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,6 @@ public double this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Double3(System.Numerics.Vector3 v) => new(v.X, v.Y, v.Z);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector3(Double3 v) => new((float)v.X, (float)v.Y, (float)v.Z);


/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions sources/core/Stride.Core.Mathematics/Double4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -204,18 +204,6 @@ public double this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Double4(System.Numerics.Vector4 v) => new(v.X, v.Y, v.Z, v.W);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector4(Double4 v) => new((float)v.X, (float)v.Y,(float)v.Z,(float)v.W);

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions sources/core/Stride.Core.Mathematics/Int2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,18 +156,6 @@ public int this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator Int2(System.Numerics.Vector2 v) => new((int)v.X,(int)v.Y);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector2(Int2 v) => new(v.X, v.Y);

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions sources/core/Stride.Core.Mathematics/Int3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -175,18 +175,6 @@ public int this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator Int3(System.Numerics.Vector3 v) => new((int)v.X, (int)v.Y, (int)v.Z);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector3(Int3 v) => new(v.X, v.Y, v.Z);

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
12 changes: 0 additions & 12 deletions sources/core/Stride.Core.Mathematics/Int4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -187,18 +187,6 @@ public int this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator Int4(System.Numerics.Vector4 v) => new((int)v.X, (int)v.Y, (int)v.Z, (int)v.W);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector4(Int4 v) => new(v.X, v.Y, v.Z, v.W);

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
28 changes: 0 additions & 28 deletions sources/core/Stride.Core.Mathematics/Matrix.cs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
#pragma warning disable SA1313 // Parameter names must begin with lower-case letter
using System;
using System.Globalization;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

namespace Stride.Core.Mathematics
Expand Down Expand Up @@ -446,33 +445,6 @@ public float this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths matrix
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Matrix(System.Numerics.Matrix4x4 v)
{
return new(
v.M11, v.M12, v.M13, v.M14,
v.M21, v.M22, v.M23, v.M24,
v.M31, v.M32, v.M33, v.M34,
v.M41, v.M42, v.M43, v.M44
);
}
/// <summary>
/// Casts from Stride.Maths to System.Numerics matrix
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator System.Numerics.Matrix4x4(Matrix v)
{
return new(
v.M11, v.M12, v.M13, v.M14,
v.M21, v.M22, v.M23, v.M24,
v.M31, v.M32, v.M33, v.M34,
v.M41, v.M42, v.M43, v.M44
);
}

/// <summary>
/// Gets or sets the component at the specified index.
/// </summary>
Expand Down
13 changes: 0 additions & 13 deletions sources/core/Stride.Core.Mathematics/UInt4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -183,19 +183,6 @@ public uint this[uint index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator UInt4(System.Numerics.Vector4 v) => new((uint)v.X, (uint)v.Y,(uint)v.Z,(uint)v.W);

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static explicit operator System.Numerics.Vector4(UInt4 v) => new(v.X, v.Y, v.Z, v.W);


/// <summary>
/// Creates an array containing the elements of the vector.
/// </summary>
Expand Down
18 changes: 0 additions & 18 deletions sources/core/Stride.Core.Mathematics/Vector2.cs
Original file line number Diff line number Diff line change
Expand Up @@ -155,24 +155,6 @@ public float this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Vector2(System.Numerics.Vector2 v)
{
return Unsafe.As<System.Numerics.Vector2, Vector2>(ref v);
}

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator System.Numerics.Vector2(Vector2 v)
{
return Unsafe.As<Vector2, System.Numerics.Vector2>(ref v);
}

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
18 changes: 0 additions & 18 deletions sources/core/Stride.Core.Mathematics/Vector3.cs
Original file line number Diff line number Diff line change
Expand Up @@ -184,24 +184,6 @@ public float this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Vector3(System.Numerics.Vector3 v)
{
return Unsafe.As<System.Numerics.Vector3, Vector3>(ref v);
}

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator System.Numerics.Vector3(Vector3 v)
{
return Unsafe.As<Vector3, System.Numerics.Vector3>(ref v);
}

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down
18 changes: 0 additions & 18 deletions sources/core/Stride.Core.Mathematics/Vector4.cs
Original file line number Diff line number Diff line change
Expand Up @@ -216,24 +216,6 @@ public float this[int index]
}
}

/// <summary>
/// Casts from System.Numerics to Stride.Maths vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator Vector4(System.Numerics.Vector4 v)
{
return Unsafe.As<System.Numerics.Vector4, Vector4>(ref v);
}

/// <summary>
/// Casts from Stride.Maths to System.Numerics vectors
/// </summary>
/// <param name="v">Value to cast</param>
public static implicit operator System.Numerics.Vector4(Vector4 v)
{
return Unsafe.As<Vector4, System.Numerics.Vector4>(ref v);
}

/// <summary>
/// Calculates the length of the vector.
/// </summary>
Expand Down

0 comments on commit 6b02070

Please sign in to comment.