From a367378f9ebc95cbd4e595feb95dd64b0f3f2c22 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Mon, 29 Nov 2021 18:02:42 +0100 Subject: Rename Vector parameters to be consistent Renames parameters that were named differently across different scripting languages or their documentation to use the same name everywhere. --- .../glue/GodotSharp/GodotSharp/Core/Vector2.cs | 18 +++---- .../glue/GodotSharp/GodotSharp/Core/Vector2i.cs | 32 ++++++------ .../glue/GodotSharp/GodotSharp/Core/Vector3.cs | 58 +++++++++++----------- .../glue/GodotSharp/GodotSharp/Core/Vector3i.cs | 24 ++++----- 4 files changed, 66 insertions(+), 66 deletions(-) (limited to 'modules') diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 0c3331900a..30ecd22db7 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -184,13 +184,13 @@ namespace Godot } /// - /// Returns the cross product of this vector and . + /// Returns the cross product of this vector and . /// - /// The other vector. + /// The other vector. /// The cross product value. - public real_t Cross(Vector2 b) + public real_t Cross(Vector2 with) { - return (x * b.y) - (y * b.x); + return (x * with.y) - (y * with.x); } /// @@ -222,13 +222,13 @@ namespace Godot } /// - /// Returns the normalized vector pointing from this vector to . + /// Returns the normalized vector pointing from this vector to . /// - /// The other vector to point towards. - /// The direction from this vector to . - public Vector2 DirectionTo(Vector2 b) + /// The other vector to point towards. + /// The direction from this vector to . + public Vector2 DirectionTo(Vector2 to) { - return new Vector2(b.x - x, b.y - y).Normalized(); + return new Vector2(to.x - x, to.y - y).Normalized(); } /// diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs index 6cac16d53b..3bbc2ae2ba 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2i.cs @@ -149,45 +149,45 @@ namespace Godot } /// - /// Returns the cross product of this vector and . + /// Returns the cross product of this vector and . /// - /// The other vector. + /// The other vector. /// The cross product vector. - public int Cross(Vector2i b) + public int Cross(Vector2i with) { - return x * b.y - y * b.x; + return x * with.y - y * with.x; } /// - /// Returns the squared distance between this vector and . + /// Returns the squared distance between this vector and . /// This method runs faster than , so prefer it if /// you need to compare vectors or need the squared distance for some formula. /// - /// The other vector to use. + /// The other vector to use. /// The squared distance between the two vectors. - public int DistanceSquaredTo(Vector2i b) + public int DistanceSquaredTo(Vector2i to) { - return (b - this).LengthSquared(); + return (to - this).LengthSquared(); } /// - /// Returns the distance between this vector and . + /// Returns the distance between this vector and . /// - /// The other vector to use. + /// The other vector to use. /// The distance between the two vectors. - public real_t DistanceTo(Vector2i b) + public real_t DistanceTo(Vector2i to) { - return (b - this).Length(); + return (to - this).Length(); } /// - /// Returns the dot product of this vector and . + /// Returns the dot product of this vector and . /// - /// The other vector to use. + /// The other vector to use. /// The dot product of the two vectors. - public int Dot(Vector2i b) + public int Dot(Vector2i with) { - return x * b.x + y * b.y; + return x * with.x + y * with.y; } /// diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 63d9be0a6d..15acf88f62 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -170,17 +170,17 @@ namespace Godot } /// - /// Returns the cross product of this vector and . + /// Returns the cross product of this vector and . /// - /// The other vector. + /// The other vector. /// The cross product vector. - public Vector3 Cross(Vector3 b) + public Vector3 Cross(Vector3 with) { return new Vector3 ( - (y * b.z) - (z * b.y), - (z * b.x) - (x * b.z), - (x * b.y) - (y * b.x) + (y * with.z) - (z * with.y), + (z * with.x) - (x * with.z), + (x * with.y) - (y * with.x) ); } @@ -212,46 +212,46 @@ namespace Godot } /// - /// Returns the normalized vector pointing from this vector to . + /// Returns the normalized vector pointing from this vector to . /// - /// The other vector to point towards. - /// The direction from this vector to . - public Vector3 DirectionTo(Vector3 b) + /// The other vector to point towards. + /// The direction from this vector to . + public Vector3 DirectionTo(Vector3 to) { - return new Vector3(b.x - x, b.y - y, b.z - z).Normalized(); + return new Vector3(to.x - x, to.y - y, to.z - z).Normalized(); } /// - /// Returns the squared distance between this vector and . + /// Returns the squared distance between this vector and . /// This method runs faster than , so prefer it if /// you need to compare vectors or need the squared distance for some formula. /// - /// The other vector to use. + /// The other vector to use. /// The squared distance between the two vectors. - public real_t DistanceSquaredTo(Vector3 b) + public real_t DistanceSquaredTo(Vector3 to) { - return (b - this).LengthSquared(); + return (to - this).LengthSquared(); } /// - /// Returns the distance between this vector and . + /// Returns the distance between this vector and . /// /// - /// The other vector to use. + /// The other vector to use. /// The distance between the two vectors. - public real_t DistanceTo(Vector3 b) + public real_t DistanceTo(Vector3 to) { - return (b - this).Length(); + return (to - this).Length(); } /// - /// Returns the dot product of this vector and . + /// Returns the dot product of this vector and . /// - /// The other vector to use. + /// The other vector to use. /// The dot product of the two vectors. - public real_t Dot(Vector3 b) + public real_t Dot(Vector3 with) { - return (x * b.x) + (y * b.y) + (z * b.z); + return (x * with.x) + (y * with.y) + (z * with.z); } /// @@ -412,16 +412,16 @@ namespace Godot } /// - /// Returns the outer product with . + /// Returns the outer product with . /// - /// The other vector. + /// The other vector. /// A representing the outer product matrix. - public Basis Outer(Vector3 b) + public Basis Outer(Vector3 with) { return new Basis( - x * b.x, x * b.y, x * b.z, - y * b.x, y * b.y, y * b.z, - z * b.x, z * b.y, z * b.z + x * with.x, x * with.y, x * with.z, + y * with.x, y * with.y, y * with.z, + z * with.x, z * with.y, z * with.z ); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs index 474876fc91..562f653fa8 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3i.cs @@ -124,36 +124,36 @@ namespace Godot } /// - /// Returns the squared distance between this vector and . + /// Returns the squared distance between this vector and . /// This method runs faster than , so prefer it if /// you need to compare vectors or need the squared distance for some formula. /// - /// The other vector to use. + /// The other vector to use. /// The squared distance between the two vectors. - public int DistanceSquaredTo(Vector3i b) + public int DistanceSquaredTo(Vector3i to) { - return (b - this).LengthSquared(); + return (to - this).LengthSquared(); } /// - /// Returns the distance between this vector and . + /// Returns the distance between this vector and . /// /// - /// The other vector to use. + /// The other vector to use. /// The distance between the two vectors. - public real_t DistanceTo(Vector3i b) + public real_t DistanceTo(Vector3i to) { - return (b - this).Length(); + return (to - this).Length(); } /// - /// Returns the dot product of this vector and . + /// Returns the dot product of this vector and . /// - /// The other vector to use. + /// The other vector to use. /// The dot product of the two vectors. - public int Dot(Vector3i b) + public int Dot(Vector3i with) { - return x * b.x + y * b.y + z * b.z; + return x * with.x + y * with.y + z * with.z; } /// -- cgit v1.2.3