aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
diff options
context:
space:
mode:
authorTeravus Ovares2009-04-07 16:41:07 +0000
committerTeravus Ovares2009-04-07 16:41:07 +0000
commitb326b55bcd7b794cb90c0df9337cc817db58f9a2 (patch)
treecbe83e72a67749f2c1cf24750dbbd42cdf54bfcb /OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
parent* Added a routine to check if a PhysicsVector and Quaternion is finite (diff)
downloadopensim-SC_OLD-b326b55bcd7b794cb90c0df9337cc817db58f9a2.zip
opensim-SC_OLD-b326b55bcd7b794cb90c0df9337cc817db58f9a2.tar.gz
opensim-SC_OLD-b326b55bcd7b794cb90c0df9337cc817db58f9a2.tar.bz2
opensim-SC_OLD-b326b55bcd7b794cb90c0df9337cc817db58f9a2.tar.xz
* Added finite testing to the character and object constructor
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs18
1 files changed, 18 insertions, 0 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index a55ae76..5e7ec37 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -173,6 +173,11 @@ namespace OpenSim.Region.Physics.OdePlugin
173 //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned); 173 //gc = GCHandle.Alloc(prim_geom, GCHandleType.Pinned);
174 ode = dode; 174 ode = dode;
175 _velocity = new PhysicsVector(); 175 _velocity = new PhysicsVector();
176 if (!PhysicsVector.isFinite(pos))
177 {
178 pos = new PhysicsVector(128, 128, parent_scene.GetTerrainHeightAtXY(128, 128) + 0.5f);
179 m_log.Warn("[PHYSICS]: Got nonFinite Object create Position");
180 }
176 _position = pos; 181 _position = pos;
177 m_taintposition = pos; 182 m_taintposition = pos;
178 PID_D = parent_scene.bodyPIDD; 183 PID_D = parent_scene.bodyPIDD;
@@ -185,6 +190,12 @@ namespace OpenSim.Region.Physics.OdePlugin
185 prim_geom = IntPtr.Zero; 190 prim_geom = IntPtr.Zero;
186 prev_geom = IntPtr.Zero; 191 prev_geom = IntPtr.Zero;
187 192
193 if (!PhysicsVector.isFinite(pos))
194 {
195 size = new PhysicsVector(0.5f, 0.5f, 0.5f);
196 m_log.Warn("[PHYSICS]: Got nonFinite Object create Size");
197 }
198
188 if (size.X <= 0) size.X = 0.01f; 199 if (size.X <= 0) size.X = 0.01f;
189 if (size.Y <= 0) size.Y = 0.01f; 200 if (size.Y <= 0) size.Y = 0.01f;
190 if (size.Z <= 0) size.Z = 0.01f; 201 if (size.Z <= 0) size.Z = 0.01f;
@@ -193,6 +204,13 @@ namespace OpenSim.Region.Physics.OdePlugin
193 m_taintsize = _size; 204 m_taintsize = _size;
194 _acceleration = new PhysicsVector(); 205 _acceleration = new PhysicsVector();
195 m_rotationalVelocity = PhysicsVector.Zero; 206 m_rotationalVelocity = PhysicsVector.Zero;
207
208 if (!QuaternionIsFinite(rotation))
209 {
210 rotation = Quaternion.Identity;
211 m_log.Warn("[PHYSICS]: Got nonFinite Object create Rotation");
212 }
213
196 _orientation = rotation; 214 _orientation = rotation;
197 m_taintrot = _orientation; 215 m_taintrot = _orientation;
198 _mesh = mesh; 216 _mesh = mesh;