diff options
| author | Xavier Cho | 2018-04-08 12:28:24 +0900 |
|---|---|---|
| committer | Xavier Cho | 2018-04-17 07:39:37 +0900 |
| commit | 0ef3e0577b4c3889d19e6f301e06fba39e8187d5 (patch) | |
| tree | eb58943180f4c509caf990d2780782aa1f74f550 /modules/mono/glue/cs_files/Quat.cs | |
| parent | 9e2e6bb1e236e5d99d74dca0cd5d31d533b76c2e (diff) | |
| download | godot-0ef3e0577b4c3889d19e6f301e06fba39e8187d5.tar.gz godot-0ef3e0577b4c3889d19e6f301e06fba39e8187d5.tar.zst godot-0ef3e0577b4c3889d19e6f301e06fba39e8187d5.zip | |
Diffstat (limited to 'modules/mono/glue/cs_files/Quat.cs')
| -rw-r--r-- | modules/mono/glue/cs_files/Quat.cs | 45 |
1 files changed, 16 insertions, 29 deletions
diff --git a/modules/mono/glue/cs_files/Quat.cs b/modules/mono/glue/cs_files/Quat.cs index 0cf3e00dd..cfdb5f21e 100644 --- a/modules/mono/glue/cs_files/Quat.cs +++ b/modules/mono/glue/cs_files/Quat.cs @@ -1,6 +1,5 @@ using System; using System.Runtime.InteropServices; - #if REAL_T_IS_DOUBLE using real_t = System.Double; #else @@ -106,10 +105,10 @@ namespace Godot } public void Set(Quat q) { - this.x = q.x; - this.y = q.y; - this.z = q.z; - this.w = q.w; + x = q.x; + y = q.y; + z = q.z; + w = q.w; } public Quat Slerp(Quat b, real_t t) @@ -165,7 +164,7 @@ namespace Godot public Quat Slerpni(Quat b, real_t t) { - real_t dot = this.Dot(b); + real_t dot = Dot(b); if (Mathf.Abs(dot) > 0.9999f) { @@ -179,17 +178,17 @@ namespace Godot return new Quat ( - invFactor * this.x + newFactor * b.x, - invFactor * this.y + newFactor * b.y, - invFactor * this.z + newFactor * b.z, - invFactor * this.w + newFactor * b.w + invFactor * x + newFactor * b.x, + invFactor * y + newFactor * b.y, + invFactor * z + newFactor * b.z, + invFactor * w + newFactor * b.w ); } public Vector3 Xform(Vector3 v) { Quat q = this * v; - q *= this.Inverse(); + q *= Inverse(); return new Vector3(q.x, q.y, q.z); } @@ -203,10 +202,10 @@ namespace Godot } public Quat(Quat q) { - this.x = q.x; - this.y = q.y; - this.z = q.z; - this.w = q.w; + x = q.x; + y = q.y; + z = q.z; + w = q.w; } public Quat(Vector3 axis, real_t angle) @@ -327,24 +326,12 @@ namespace Godot public override string ToString() { - return String.Format("({0}, {1}, {2}, {3})", new object[] - { - this.x.ToString(), - this.y.ToString(), - this.z.ToString(), - this.w.ToString() - }); + return String.Format("({0}, {1}, {2}, {3})", x.ToString(), y.ToString(), z.ToString(), w.ToString()); } public string ToString(string format) { - return String.Format("({0}, {1}, {2}, {3})", new object[] - { - this.x.ToString(format), - this.y.ToString(format), - this.z.ToString(format), - this.w.ToString(format) - }); + return String.Format("({0}, {1}, {2}, {3})", x.ToString(format), y.ToString(format), z.ToString(format), w.ToString(format)); } } } |
