diff options
author | Aaron Franke <arnfranke@yahoo.com> | 2020-12-07 03:16:31 -0500 |
---|---|---|
committer | Aaron Franke <arnfranke@yahoo.com> | 2020-12-07 05:01:33 -0500 |
commit | 5465e604bb8118450feb7422793efb7dc3e9d28b (patch) | |
tree | 64d86d44d5bc7939e879e1421046f9596445764c /modules/mono/glue | |
parent | 73eb8d5a2094fc7512b17712b402bdb73c5f5b63 (diff) |
Improve argument names for core types
Diffstat (limited to 'modules/mono/glue')
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs | 10 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs | 5 | ||||
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs | 5 |
3 files changed, 11 insertions, 9 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs index b33490f9cb..bd3bcb0c58 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs @@ -120,13 +120,13 @@ namespace Godot /// <param name="b">The destination quaternion.</param> /// <param name="preA">A quaternion before this quaternion.</param> /// <param name="postB">A quaternion after `b`.</param> - /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <param name="weight">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> /// <returns>The interpolated quaternion.</returns> - public Quat CubicSlerp(Quat b, Quat preA, Quat postB, real_t t) + public Quat CubicSlerp(Quat b, Quat preA, Quat postB, real_t weight) { - real_t t2 = (1.0f - t) * t * 2f; - Quat sp = Slerp(b, t); - Quat sq = preA.Slerpni(postB, t); + real_t t2 = (1.0f - weight) * weight * 2f; + Quat sp = Slerp(b, weight); + Quat sq = preA.Slerpni(postB, weight); return sp.Slerpni(sq, t2); } diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs index d536b14eac..b74dd6f4f4 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs @@ -194,15 +194,16 @@ namespace Godot /// <param name="b">The destination vector.</param> /// <param name="preA">A vector before this vector.</param> /// <param name="postB">A vector after `b`.</param> - /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <param name="weight">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> /// <returns>The interpolated vector.</returns> - public Vector2 CubicInterpolate(Vector2 b, Vector2 preA, Vector2 postB, real_t t) + public Vector2 CubicInterpolate(Vector2 b, Vector2 preA, Vector2 postB, real_t weight) { Vector2 p0 = preA; Vector2 p1 = this; Vector2 p2 = b; Vector2 p3 = postB; + real_t t = weight; real_t t2 = t * t; real_t t3 = t2 * t; diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs index 4a4a2a43cd..07f5b3c38e 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs @@ -161,15 +161,16 @@ namespace Godot /// <param name="b">The destination vector.</param> /// <param name="preA">A vector before this vector.</param> /// <param name="postB">A vector after `b`.</param> - /// <param name="t">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> + /// <param name="weight">A value on the range of 0.0 to 1.0, representing the amount of interpolation.</param> /// <returns>The interpolated vector.</returns> - public Vector3 CubicInterpolate(Vector3 b, Vector3 preA, Vector3 postB, real_t t) + public Vector3 CubicInterpolate(Vector3 b, Vector3 preA, Vector3 postB, real_t weight) { Vector3 p0 = preA; Vector3 p1 = this; Vector3 p2 = b; Vector3 p3 = postB; + real_t t = weight; real_t t2 = t * t; real_t t3 = t2 * t; |