summaryrefslogtreecommitdiff
path: root/modules/mono/glue/GodotSharp
diff options
context:
space:
mode:
authorRaul Santos <raulsntos@gmail.com>2022-08-24 12:36:46 +0200
committerRaul Santos <raulsntos@gmail.com>2022-08-27 12:26:37 +0200
commitb35fcf362027d147dba359911d0e94d3160ff238 (patch)
tree6d10132876506b861458f7d7738f3ffb5b25bfba /modules/mono/glue/GodotSharp
parentf9998455cee262de0f5b82ea556f644353235a47 (diff)
C#: Add missing match check in `Quaternion.Slerpni`
Diffstat (limited to 'modules/mono/glue/GodotSharp')
-rw-r--r--modules/mono/glue/GodotSharp/GodotSharp/Core/Quaternion.cs11
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)