From 2e89c0185172591198bf5f3a61034dde3e88fb00 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Wed, 13 Feb 2008 19:06:35 +0000 Subject: * This fixes mantis 553 (It appears that the exception is thrown when there is a collision with a cylinder that is both hollowed and either tapered or cut. The sequence of actions that reproduce the problem for me are: create a cylinder, hollow to 95%, taper X/Y, then collide it with another object or avatar. Note that the cylinder itself is not marked physical. ) --- OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 2 +- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 11 +++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) (limited to 'OpenSim/Region/Physics/OdePlugin') diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index a01cf1e..6103320 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs @@ -92,7 +92,7 @@ namespace OpenSim.Region.Physics.OdePlugin public OdePrim(String primName, OdeScene parent_scene, IntPtr targetSpace, PhysicsVector pos, PhysicsVector size, Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical) { - System.Threading.Thread.Sleep(20); + _velocity = new PhysicsVector(); _position = pos; m_taintposition = pos; diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index a2f354a..1c16cfb 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -730,7 +730,16 @@ namespace OpenSim.Region.Physics.OdePlugin } } } + try + { + d.GeomDestroy(prim.prim_geom); + } + catch (System.AccessViolationException) + { + m_log.Info("[PHYSICS]: Couldn't remove prim from physics scene, it was already be removed."); + } + _prims.Remove(prim); //If there are no more geometries in the sub-space, we don't need it in the main space anymore if (d.SpaceGetNumGeoms(prim.m_targetSpace) == 0) @@ -755,9 +764,7 @@ namespace OpenSim.Region.Physics.OdePlugin } } - d.GeomDestroy(prim.prim_geom); - _prims.Remove(prim); } } /// -- cgit v1.1