From b35fcf362027d147dba359911d0e94d3160ff238 Mon Sep 17 00:00:00 2001 From: Raul Santos Date: Wed, 24 Aug 2022 12:36:46 +0200 Subject: C#: Add missing match check in `Quaternion.Slerpni` --- modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'modules/mono/glue') 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 /// The resulting quaternion of the interpolation. 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) -- cgit v1.2.3