From ef9e2c8ca8d19da49327f220091a2ed948a42847 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Mon, 1 Aug 2022 02:42:20 +0200 Subject: [PATCH] Rename math 'phi' arguments to 'angle' in C# (cherry picked from commit d0e586fc7e25da58544419793ea6ca6d29081269) --- modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs | 10 +++++----- .../mono/glue/GodotSharp/GodotSharp/Core/Transform.cs | 4 ++-- .../glue/GodotSharp/GodotSharp/Core/Transform2D.cs | 4 ++-- .../mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs | 6 +++--- .../mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index 5caf4e97984..dce1b11ed74 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -506,9 +506,9 @@ namespace Godot /// The axis to rotate around. Must be normalized. /// The angle to rotate, in radians. /// The rotated basis matrix. - public Basis Rotated(Vector3 axis, real_t phi) + public Basis Rotated(Vector3 axis, real_t angle) { - return new Basis(axis, phi) * this; + return new Basis(axis, angle) * this; } /// @@ -807,15 +807,15 @@ namespace Godot /// /// The axis to rotate around. Must be normalized. /// The angle to rotate, in radians. - public Basis(Vector3 axis, real_t phi) + public Basis(Vector3 axis, real_t angle) { Vector3 axisSq = new Vector3(axis.x * axis.x, axis.y * axis.y, axis.z * axis.z); - real_t cosine = Mathf.Cos(phi); + real_t cosine = Mathf.Cos(angle); Row0.x = axisSq.x + cosine * (1.0f - axisSq.x); Row1.y = axisSq.y + cosine * (1.0f - axisSq.y); Row2.z = axisSq.z + cosine * (1.0f - axisSq.z); - real_t sine = Mathf.Sin(phi); + real_t sine = Mathf.Sin(angle); real_t t = 1.0f - cosine; real_t xyzt = axis.x * axis.y * t; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs index 75de804d8f8..43bc82b10db 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform.cs @@ -190,9 +190,9 @@ namespace Godot /// The axis to rotate around. Must be normalized. /// The angle to rotate, in radians. /// The rotated transformation matrix. - public Transform Rotated(Vector3 axis, real_t phi) + public Transform Rotated(Vector3 axis, real_t angle) { - return new Transform(new Basis(axis, phi), new Vector3()) * this; + return new Transform(new Basis(axis, angle), new Vector3()) * this; } /// diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs index 698889fbfdd..441efb508ae 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Transform2D.cs @@ -301,9 +301,9 @@ namespace Godot /// /// The angle to rotate, in radians. /// The rotated transformation matrix. - public Transform2D Rotated(real_t phi) + public Transform2D Rotated(real_t angle) { - return this * new Transform2D(phi, new Vector2()); + return this * new Transform2D(angle, new Vector2()); } /// diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index 3da58c6b62d..19208c80ae0 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -488,10 +488,10 @@ namespace Godot /// /// The angle to rotate by, in radians. /// The rotated vector. - public Vector2 Rotated(real_t phi) + public Vector2 Rotated(real_t angle) { - real_t sine = Mathf.Sin(phi); - real_t cosi = Mathf.Cos(phi); + real_t sine = Mathf.Sin(angle); + real_t cosi = Mathf.Cos(angle); return new Vector2( x * cosi - y * sine, x * sine + y * cosi); diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 9512380a94b..5d27a004116 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -474,7 +474,7 @@ namespace Godot /// The vector to rotate around. Must be normalized. /// The angle to rotate by, in radians. /// The rotated vector. - public Vector3 Rotated(Vector3 axis, real_t phi) + public Vector3 Rotated(Vector3 axis, real_t angle) { #if DEBUG if (!axis.IsNormalized()) @@ -482,7 +482,7 @@ namespace Godot throw new ArgumentException("Argument is not normalized", nameof(axis)); } #endif - return new Basis(axis, phi).Xform(this); + return new Basis(axis, angle).Xform(this); } ///