From 5465e604bb8118450feb7422793efb7dc3e9d28b Mon Sep 17 00:00:00 2001 From: Aaron Franke Date: Mon, 7 Dec 2020 03:16:31 -0500 Subject: Improve argument names for core types --- modules/mono/glue/GodotSharp/GodotSharp/Core/Quat.cs | 10 +++++----- modules/mono/glue/GodotSharp/GodotSharp/Core/Vector2.cs | 5 +++-- modules/mono/glue/GodotSharp/GodotSharp/Core/Vector3.cs | 5 +++-- 3 files changed, 11 insertions(+), 9 deletions(-) (limited to 'modules/mono/glue') 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 /// The destination quaternion. /// A quaternion before this quaternion. /// A quaternion after `b`. - /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. + /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. /// The interpolated quaternion. - 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 /// The destination vector. /// A vector before this vector. /// A vector after `b`. - /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. + /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. /// The interpolated vector. - 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 /// The destination vector. /// A vector before this vector. /// A vector after `b`. - /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. + /// A value on the range of 0.0 to 1.0, representing the amount of interpolation. /// The interpolated vector. - 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; -- cgit v1.2.3