diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager')
-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; |