Check For NaN and Infinity in llRot2Axis/Angle Fixes mantis #6669

cpu-performance
teravus 2013-06-10 18:47:08 -05:00
parent a949556c4e
commit 1c7fbb86c2
1 changed files with 4 additions and 2 deletions

View File

@ -4692,7 +4692,9 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
y = rot.y / s;
z = rot.z / s;
}
if ((double.IsNaN(x)) || double.IsInfinity(x)) x = 0;
if ((double.IsNaN(y)) || double.IsInfinity(y)) y = 0;
if ((double.IsNaN(z)) || double.IsInfinity(z)) z = 0;
return new LSL_Vector(x,y,z);
}
@ -4714,7 +4716,7 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
}
double angle = 2 * Math.Acos(rot.s);
if ((double.IsNaN(angle)) || double.IsInfinity(angle)) angle = 0;
return angle;
}