From 05dc8594f05f27fa81c9c4713301dab3e87dccd7 Mon Sep 17 00:00:00 2001 From: UbitUmarov Date: Sat, 13 Jun 2020 19:06:17 +0100 Subject: [PATCH] corner cases.. --- OpenSim/Framework/ViewerEnviroment.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OpenSim/Framework/ViewerEnviroment.cs b/OpenSim/Framework/ViewerEnviroment.cs index fb1531f0bc..454f17214a 100644 --- a/OpenSim/Framework/ViewerEnviroment.cs +++ b/OpenSim/Framework/ViewerEnviroment.cs @@ -926,13 +926,13 @@ namespace OpenSim.Framework private static Quaternion AzAlToRot(float az, float al) { - if (al == 0) + if (Utils.ApproxEqual(al, 0, 1e-3f) || Utils.ApproxEqual(Math.Abs(al), Utils.TWO_PI, 1e-3f)) { az *= 0.5f; return new Quaternion(0, 0, (float)Math.Sin(az), (float)Math.Cos(az)); } - if(az == 0) + if (Utils.ApproxEqual(az, 0, 1e-3f) || Utils.ApproxEqual(Math.Abs(az), Utils.TWO_PI, 1e-3f)) { al *= 0.5f; return new Quaternion(0, -(float)Math.Sin(al), 0, (float)Math.Cos(al));