From 949a2778ca65c1b8d88c5ff1bea51b58ead30ea2 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Sat, 14 Jan 2023 20:06:45 +0100 Subject: C#: Sync `Basis` with Core - Remove `GetOrthogonalIndex` method (moved to `GridMap`). - Remove `GetRow` and `SetRow` methods. --- .../mono/glue/GodotSharp/GodotSharp/Core/Basis.cs | 109 --------------------- 1 file changed, 109 deletions(-) diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs index 5aa1622bf8..90fdb14953 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Basis.cs @@ -493,12 +493,6 @@ namespace Godot } } - /// - /// Returns the basis's rotation in the form of a quaternion. - /// See if you need Euler angles, but keep in - /// mind that quaternions should generally be preferred to Euler angles. - /// - /// A representing the basis's rotation. internal readonly Quaternion GetQuaternion() { real_t trace = Row0[0] + Row1[1] + Row2[2]; @@ -572,109 +566,6 @@ namespace Godot return orthonormalizedBasis.GetQuaternion(); } - /// - /// Get rows by index. Rows are not very useful for user code, - /// but are more efficient for some internal calculations. - /// - /// Which row. - /// - /// is not 0, 1 or 2. - /// - /// One of Row0, Row1, or Row2. - public readonly Vector3 GetRow(int index) - { - switch (index) - { - case 0: - return Row0; - case 1: - return Row1; - case 2: - return Row2; - default: - throw new ArgumentOutOfRangeException(nameof(index)); - } - } - - /// - /// Sets rows by index. Rows are not very useful for user code, - /// but are more efficient for some internal calculations. - /// - /// Which row. - /// The vector to set the row to. - /// - /// is not 0, 1 or 2. - /// - public void SetRow(int index, Vector3 value) - { - switch (index) - { - case 0: - Row0 = value; - return; - case 1: - Row1 = value; - return; - case 2: - Row2 = value; - return; - default: - throw new ArgumentOutOfRangeException(nameof(index)); - } - } - - /// - /// This function considers a discretization of rotations into - /// 24 points on unit sphere, lying along the vectors (x, y, z) with - /// each component being either -1, 0, or 1, and returns the index - /// of the point best representing the orientation of the object. - /// It is mainly used by the editor. - /// - /// For further details, refer to the Godot source code. - /// - /// The orthogonal index. - public readonly int GetOrthogonalIndex() - { - var orth = this; - - for (int i = 0; i < 3; i++) - { - for (int j = 0; j < 3; j++) - { - var row = orth.GetRow(i); - - real_t v = row[j]; - - if (v > 0.5f) - { - v = 1.0f; - } - else if (v < -0.5f) - { - v = -1.0f; - } - else - { - v = 0f; - } - - row[j] = v; - - orth.SetRow(i, row); - } - } - - for (int i = 0; i < 24; i++) - { - if (orth == _orthoBases[i]) - { - return i; - } - } - - return 0; - } - /// /// Returns the inverse of the matrix. /// -- cgit v1.2.3