diff options
author | Raul Santos <raulsntos@gmail.com> | 2022-08-24 12:36:46 +0200 |
---|---|---|
committer | Raul Santos <raulsntos@gmail.com> | 2022-08-27 12:26:37 +0200 |
commit | b35fcf362027d147dba359911d0e94d3160ff238 (patch) | |
tree | 6d10132876506b861458f7d7738f3ffb5b25bfba /modules/mono/glue | |
parent | f9998455cee262de0f5b82ea556f644353235a47 (diff) |
C#: Add missing match check in `Quaternion.Slerpni`
Diffstat (limited to 'modules/mono/glue')
-rw-r--r-- | modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs index 999500ca13..529ddc2cfb 100644 --- a/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs +++ b/modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs @@ -292,6 +292,17 @@ namespace Godot /// <returns>The resulting quaternion of the interpolation.</returns> public Quaternion Slerpni(Quaternion to, real_t weight) { +#if DEBUG + if (!IsNormalized()) + { + throw new InvalidOperationException("Quaternion is not normalized"); + } + if (!to.IsNormalized()) + { + throw new ArgumentException("Argument is not normalized", nameof(to)); + } +#endif + real_t dot = Dot(to); if (Mathf.Abs(dot) > 0.9999f) |