Skip to content

Commit

Permalink
Fix missing "this" keyword in ToSystem and ToGeneric for 4d vector (#…
Browse files Browse the repository at this point in the history
…1584)

* start of adding missing this keyword in ToSystem and ToGeneric parameters for Vector4D<T>

* Added missed "this" keyword in SystemNumericsExtensions

* Added ToSystem and ToGeneric methods to public api for Vector4 and Vector4D<T>
  • Loading branch information
Wafer-EX authored Jul 22, 2023
1 parent b3ced41 commit 45143a4
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1246,13 +1246,15 @@ static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Pl
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Quaternion value) -> Silk.NET.Maths.Quaternion<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector2 value) -> Silk.NET.Maths.Vector2D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector3 value) -> Silk.NET.Maths.Vector3D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToGeneric(this System.Numerics.Vector4 value) -> Silk.NET.Maths.Vector4D<float>
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix3X2<float> value) -> System.Numerics.Matrix3x2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Matrix4X4<float> value) -> System.Numerics.Matrix4x4
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Plane<float> value) -> System.Numerics.Plane
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Quaternion<float> value) -> System.Numerics.Quaternion
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector2D<float> value) -> System.Numerics.Vector2
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector3D<float> value) -> System.Numerics.Vector3
static Silk.NET.Maths.SystemNumericsExtensions.ToSystem(this Silk.NET.Maths.Vector4D<float> value) -> System.Numerics.Vector4
static Silk.NET.Maths.Vector2D.Abs<T>(Silk.NET.Maths.Vector2D<T> value) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Add<T>(Silk.NET.Maths.Vector2D<T> left, Silk.NET.Maths.Vector2D<T> right) -> Silk.NET.Maths.Vector2D<T>
static Silk.NET.Maths.Vector2D.Clamp<T>(Silk.NET.Maths.Vector2D<T> value1, Silk.NET.Maths.Vector2D<T> min, Silk.NET.Maths.Vector2D<T> max) -> Silk.NET.Maths.Vector2D<T>
Expand Down
6 changes: 3 additions & 3 deletions src/Maths/Silk.NET.Maths/SystemNumericsExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public static System.Numerics.Vector3 ToSystem(this Vector3D<float> value)
/// </summary>
/// <param name="value">The source vector</param>
/// <returns>The converted vector</returns>
public static System.Numerics.Vector4 ToSystem(Vector4D<float> value)
public static System.Numerics.Vector4 ToSystem(this Vector4D<float> value)
=> new(value.X, value.Y, value.Z, value.W);

/// <summary>
Expand Down Expand Up @@ -127,7 +127,7 @@ public static Vector3D<float> ToGeneric(this System.Numerics.Vector3 value)
/// </summary>
/// <param name="value">The source vector</param>
/// <returns>The converted vector</returns>
public static Vector4D<float> ToGeneric(System.Numerics.Vector4 value)
public static Vector4D<float> ToGeneric(this System.Numerics.Vector4 value)
=> new(value.X, value.Y, value.Z, value.W);
}
}
}

0 comments on commit 45143a4

Please sign in to comment.