From 9d786ab096ed36ea384e03ee5cea498790e31eec Mon Sep 17 00:00:00 2001 From: Jean-Philippe Bruyère Date: Sun, 17 Jul 2022 20:26:28 +0200 Subject: wip --- Samples/AnimTest/Animation/MathHelper.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 Samples/AnimTest/Animation/MathHelper.cs (limited to 'Samples/AnimTest/Animation/MathHelper.cs') diff --git a/Samples/AnimTest/Animation/MathHelper.cs b/Samples/AnimTest/Animation/MathHelper.cs new file mode 100644 index 00000000..35a3009f --- /dev/null +++ b/Samples/AnimTest/Animation/MathHelper.cs @@ -0,0 +1,16 @@ +// Copyright (c) 2019-2021 Jean-Philippe Bruyère +// +// This code is licensed under the MIT license (MIT) (http://opensource.org/licenses/MIT) +using System; +namespace vke { + public static class MathHelper { + public const float Pi = (float)Math.PI; + public const float TwoPi = (float)Math.PI * 2; + public static float NormalizeAngle (float a) { + float tmp = a % MathHelper.TwoPi; + if (tmp < 0) + tmp += MathHelper.TwoPi; + return tmp; + } + } +} -- cgit v1.3.1-4-g156e