1
0
mirror of https://github.com/oliverbooth/X10D synced 2024-11-23 00:18:47 +00:00

Add Vector2/3Int.ToSystemVector

This commit is contained in:
Oliver Booth 2022-06-01 18:37:33 +01:00
parent 2b8f763184
commit 43a155ad90
No known key found for this signature in database
GPG Key ID: 32A00B35503AF634
3 changed files with 26 additions and 0 deletions

View File

@ -40,10 +40,12 @@
- X10D.Unity: Added `Vector2Int.Deconstruct()`
- X10D.Unity: Added `Vector2Int.ToSystemPoint()`
- X10D.Unity: Added `Vector2Int.ToSystemSize()`
- X10D.Unity: Added `Vector2Int.ToSystemVector()`
- X10D.Unity: Added `Vector2Int.WithX()`
- X10D.Unity: Added `Vector2Int.WithY()`
- X10D.Unity: Added `Vector3.Deconstruct()`
- X10D.Unity: Added `Vector3Int.Deconstruct()`
- X10D.Unity: Added `Vector3Int.ToSystemVector()`
- X10D.Unity: Added `Vector3Int.WithX()`
- X10D.Unity: Added `Vector3Int.WithY()`
- X10D.Unity: Added `Vector3Int.WithZ()`

View File

@ -46,6 +46,18 @@ public static class Vector2IntExtensions
return new Size(vector.x, vector.y);
}
/// <summary>
/// Converts the current vector to a <see cref="System.Numerics.Vector2" />.
/// </summary>
/// <param name="vector">The vector to convert.</param>
/// <returns>The converted vector.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static System.Numerics.Vector2 ToSystemVector(this Vector2Int vector)
{
return new System.Numerics.Vector2(vector.x, vector.y);
}
/// <summary>
/// Returns a vector whose Y component is the same as the specified vector, and whose X component is a new value.
/// </summary>

View File

@ -23,6 +23,18 @@ public static class Vector3IntExtensions
z = vector.z;
}
/// <summary>
/// Converts the current vector to a <see cref="System.Numerics.Vector3" />.
/// </summary>
/// <param name="vector">The vector to convert.</param>
/// <returns>The converted vector.</returns>
[Pure]
[MethodImpl(MethodImplOptions.AggressiveInlining)]
public static System.Numerics.Vector3 ToSystemVector(this Vector3Int vector)
{
return new System.Numerics.Vector3(vector.x, vector.y, vector.z);
}
/// <summary>
/// Returns a vector whose Y and Z components are the same as the specified vector, and whose X component is a new value.
/// </summary>