* Added a routine to check if a PhysicsVector and Quaternion is finite

* Now validating input to the Physics scene and warning when something is awry.
* This should help nail down that Non Finite Avatar Position Detected issue.
This commit is contained in:
Teravus Ovares
2009-04-07 16:13:17 +00:00
parent 11f8ea30f9
commit 9bbc7e8bf6
3 changed files with 193 additions and 45 deletions

View File

@@ -153,6 +153,20 @@ namespace OpenSim.Region.Physics.Manager
return v*f;
}
public static bool isFinite(PhysicsVector v)
{
if (v == null)
return false;
if (Single.IsInfinity(v.X) || Single.IsNaN(v.X))
return false;
if (Single.IsInfinity(v.Y) || Single.IsNaN(v.Y))
return false;
if (Single.IsInfinity(v.Z) || Single.IsNaN(v.Z))
return false;
return true;
}
public virtual bool IsIdentical(PhysicsVector v, float tolerance)
{
PhysicsVector diff = this - v;