diff options
author | Teravus Ovares | 2009-04-07 16:13:17 +0000 |
---|---|---|
committer | Teravus Ovares | 2009-04-07 16:13:17 +0000 |
commit | 9bbc7e8bf690800affd4d5767959932ad033dd7c (patch) | |
tree | 555c666a712aa4de209c6ccf84107c53a743e308 /OpenSim/Region/Physics/Manager/PhysicsVector.cs | |
parent | * Tweak the BulletDotNETPlugin character controller so it feels more finished. (diff) | |
download | opensim-SC-9bbc7e8bf690800affd4d5767959932ad033dd7c.zip opensim-SC-9bbc7e8bf690800affd4d5767959932ad033dd7c.tar.gz opensim-SC-9bbc7e8bf690800affd4d5767959932ad033dd7c.tar.bz2 opensim-SC-9bbc7e8bf690800affd4d5767959932ad033dd7c.tar.xz |
* 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.
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsVector.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsVector.cs | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsVector.cs b/OpenSim/Region/Physics/Manager/PhysicsVector.cs index bbd6464..2a4ac5e 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsVector.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsVector.cs | |||
@@ -153,6 +153,20 @@ namespace OpenSim.Region.Physics.Manager | |||
153 | return v*f; | 153 | return v*f; |
154 | } | 154 | } |
155 | 155 | ||
156 | public static bool isFinite(PhysicsVector v) | ||
157 | { | ||
158 | if (v == null) | ||
159 | return false; | ||
160 | if (Single.IsInfinity(v.X) || Single.IsNaN(v.X)) | ||
161 | return false; | ||
162 | if (Single.IsInfinity(v.Y) || Single.IsNaN(v.Y)) | ||
163 | return false; | ||
164 | if (Single.IsInfinity(v.Z) || Single.IsNaN(v.Z)) | ||
165 | return false; | ||
166 | |||
167 | return true; | ||
168 | } | ||
169 | |||
156 | public virtual bool IsIdentical(PhysicsVector v, float tolerance) | 170 | public virtual bool IsIdentical(PhysicsVector v, float tolerance) |
157 | { | 171 | { |
158 | PhysicsVector diff = this - v; | 172 | PhysicsVector diff = this - v; |