mirror of
https://github.com/opensim/opensim.git
synced 2026-07-31 22:05:36 +08:00
Check For NaN and Infinity in llRot2Axis/Angle Fixes mantis #6669
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user