diff options
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 18 |
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; |