Add explicit cast to in vector in C# api

This commit is contained in:
Wojtek Figat
2025-02-11 00:32:20 +01:00
parent 3c091dc214
commit 4baa38c0cc
3 changed files with 34 additions and 4 deletions

View File

@@ -1689,6 +1689,16 @@ namespace FlaxEngine
return new Double2(value.X, value.Y);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector2" /> to <see cref="Int2" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator Int2(Vector2 value)
{
return new Int2((int)value.X, (int)value.Y);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector2" /> to <see cref="Vector3" />.
/// </summary>

View File

@@ -2011,7 +2011,7 @@ namespace FlaxEngine
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector3" /> to <see cref="Float3" />.
/// Performs an implicit conversion from <see cref="Vector3" /> to <see cref="Float3" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
@@ -2021,7 +2021,7 @@ namespace FlaxEngine
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector3" /> to <see cref="Double3" />.
/// Performs an implicit conversion from <see cref="Vector3" /> to <see cref="Double3" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
@@ -2030,6 +2030,16 @@ namespace FlaxEngine
return new Double3(value.X, value.Y, value.Z);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector3" /> to <see cref="Int3" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator Int3(Vector3 value)
{
return new Int3((int)value.X, (int)value.Y, (int)value.Z);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector3" /> to <see cref="Vector2" />.
/// </summary>

View File

@@ -1378,7 +1378,7 @@ namespace FlaxEngine
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector4" /> to <see cref="Float4" />.
/// Performs an implicit conversion from <see cref="Vector4" /> to <see cref="Float4" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
@@ -1388,7 +1388,7 @@ namespace FlaxEngine
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector4" /> to <see cref="Double4" />.
/// Performs an implicit conversion from <see cref="Vector4" /> to <see cref="Double4" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
@@ -1397,6 +1397,16 @@ namespace FlaxEngine
return new Double4(value.X, value.Y, value.Z, value.W);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector4" /> to <see cref="Int4" />.
/// </summary>
/// <param name="value">The value.</param>
/// <returns>The result of the conversion.</returns>
public static explicit operator Int4(Vector4 value)
{
return new Int4((int)value.X, (int)value.Y, (int)value.Z, (int)value.W);
}
/// <summary>
/// Performs an explicit conversion from <see cref="Vector4" /> to <see cref="Vector2" />.
/// </summary>