Merge branch 'master' into httptests

httptests
UbitUmarov 2017-08-17 00:16:29 +01:00
commit c54cd4d808
1 changed files with 9 additions and 14 deletions

View File

@ -5527,20 +5527,16 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (Math.Abs(rot.s) > 1) // normalization needed rot.Normalize();
rot.Normalize();
double s = Math.Sqrt(1 - rot.s * rot.s); double s = Math.Sqrt(1 - rot.s * rot.s);
if (s < 0.001) if (s < 1e-8)
{ return new LSL_Vector(0, 0, 0);
return new LSL_Vector(1, 0, 0);
} double invS = 1.0 / s;
else if (rot.s < 0)
{ invS = -invS;
double invS = 1.0 / s; return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS);
if (rot.s < 0) invS = -invS;
return new LSL_Vector(rot.x * invS, rot.y * invS, rot.z * invS);
}
} }
@ -5549,8 +5545,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
{ {
m_host.AddScriptLPS(1); m_host.AddScriptLPS(1);
if (Math.Abs(rot.s) > 1) // normalization needed rot.Normalize();
rot.Normalize();
double angle = 2 * Math.Acos(rot.s); double angle = 2 * Math.Acos(rot.s);
if (angle > Math.PI) if (angle > Math.PI)