diff options
| author | Yuri Roubinski <chaosus89@gmail.com> | 2023-09-17 20:59:10 +0300 |
|---|---|---|
| committer | Yuri Roubinski <chaosus89@gmail.com> | 2023-09-17 22:12:59 +0300 |
| commit | cf3008cb05d9d4c007182240d55d32b753570aad (patch) | |
| tree | 7184532a0f44f25946d62dcb3e478dfd470947c8 /modules | |
| parent | 4df80b0e629e25653a706f6721c13a1f9d1da368 (diff) | |
| download | redot-engine-cf3008cb05d9d4c007182240d55d32b753570aad.tar.gz | |
Add Vector2/3/4i.MAX and MIN (C#)
Diffstat (limited to 'modules')
3 files changed, 42 insertions, 0 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs index 231e791904..b5ff744c55 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2I.cs @@ -182,6 +182,9 @@ namespace Godot } // Constants + private static readonly Vector2I _min = new Vector2I(int.MinValue, int.MinValue); + private static readonly Vector2I _max = new Vector2I(int.MaxValue, int.MaxValue); + private static readonly Vector2I _zero = new Vector2I(0, 0); private static readonly Vector2I _one = new Vector2I(1, 1); @@ -191,6 +194,17 @@ namespace Godot private static readonly Vector2I _left = new Vector2I(-1, 0); /// <summary> + /// Min vector, a vector with all components equal to <see cref="int.MinValue"/>. Can be used as a negative integer equivalent of <see cref="Vector2.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector2I(int.MinValue, int.MinValue)</c>.</value> + public static Vector2I Min { get { return _min; } } + /// <summary> + /// Max vector, a vector with all components equal to <see cref="int.MaxValue"/>. Can be used as an integer equivalent of <see cref="Vector2.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector2I(int.MaxValue, int.MaxValue)</c>.</value> + public static Vector2I Max { get { return _max; } } + + /// <summary> /// Zero vector, a vector with all components set to <c>0</c>. /// </summary> /// <value>Equivalent to <c>new Vector2I(0, 0)</c>.</value> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs index 8543052f56..62aa02e512 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3I.cs @@ -193,6 +193,9 @@ namespace Godot } // Constants + private static readonly Vector3I _min = new Vector3I(int.MinValue, int.MinValue, int.MinValue); + private static readonly Vector3I _max = new Vector3I(int.MaxValue, int.MaxValue, int.MaxValue); + private static readonly Vector3I _zero = new Vector3I(0, 0, 0); private static readonly Vector3I _one = new Vector3I(1, 1, 1); @@ -204,6 +207,17 @@ namespace Godot private static readonly Vector3I _back = new Vector3I(0, 0, 1); /// <summary> + /// Min vector, a vector with all components equal to <see cref="int.MinValue"/>. Can be used as a negative integer equivalent of <see cref="Vector3.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector3I(int.MinValue, int.MinValue, int.MinValue)</c>.</value> + public static Vector3I Min { get { return _min; } } + /// <summary> + /// Max vector, a vector with all components equal to <see cref="int.MaxValue"/>. Can be used as an integer equivalent of <see cref="Vector3.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector3I(int.MaxValue, int.MaxValue, int.MaxValue)</c>.</value> + public static Vector3I Max { get { return _max; } } + + /// <summary> /// Zero vector, a vector with all components set to <c>0</c>. /// </summary> /// <value>Equivalent to <c>new Vector3I(0, 0, 0)</c>.</value> diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs index f813903177..56c1df4c64 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector4I.cs @@ -228,10 +228,24 @@ namespace Godot } // Constants + private static readonly Vector4I _min = new Vector4I(int.MinValue, int.MinValue, int.MinValue, int.MinValue); + private static readonly Vector4I _max = new Vector4I(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue); + private static readonly Vector4I _zero = new Vector4I(0, 0, 0, 0); private static readonly Vector4I _one = new Vector4I(1, 1, 1, 1); /// <summary> + /// Min vector, a vector with all components equal to <see cref="int.MinValue"/>. Can be used as a negative integer equivalent of <see cref="Vector4.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector4I(int.MinValue, int.MinValue, int.MinValue, int.MinValue)</c>.</value> + public static Vector4I Min { get { return _min; } } + /// <summary> + /// Max vector, a vector with all components equal to <see cref="int.MaxValue"/>. Can be used as an integer equivalent of <see cref="Vector4.Inf"/>. + /// </summary> + /// <value>Equivalent to <c>new Vector4I(int.MaxValue, int.MaxValue, int.MaxValue, int.MaxValue)</c>.</value> + public static Vector4I Max { get { return _max; } } + + /// <summary> /// Zero vector, a vector with all components set to <c>0</c>. /// </summary> /// <value>Equivalent to <c>new Vector4I(0, 0, 0, 0)</c>.</value> |
