mirror of
https://github.com/opensim/opensim.git
synced 2026-08-09 02:36:00 +08:00
* 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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user