From 8a57dd207f3416914f0d68abe4a4cd229140ef81 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Sat, 17 Nov 2007 20:34:56 +0000 Subject: * Fixed space related SimCrasher ODE error when a prim disables itself because it's out of bounds and user moves it back into the space. --- OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 37 +++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f1c7a66..03b22ae 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs @@ -357,6 +357,20 @@ namespace OpenSim.Region.Physics.OdePlugin } } } + else + { + // Everything is going slow, so we're skipping object to object collisions + // At least collide test against the ground. + foreach (OdePrim chr in _activeprims) + { + // This if may not need to be there.. it might be skipped anyway. + if (d.BodyIsEnabled(chr.Body)) + { + d.SpaceCollide2(LandGeom, chr.prim_geom, IntPtr.Zero, nearCallback); + + } + } + } } public override PhysicsActor AddAvatar(string avName, PhysicsVector position) @@ -445,8 +459,16 @@ namespace OpenSim.Region.Physics.OdePlugin { if (d.SpaceQuery(currentspace, geom)) { + d.SpaceRemove(currentspace, geom); } + else + { + IntPtr sGeomIsIn = d.GeomGetSpace(geom); + if (sGeomIsIn != null) + d.SpaceRemove(sGeomIsIn, geom); + } + //If there are no more geometries in the sub-space, we don't need it in the main space anymore if (d.SpaceGetNumGeoms(currentspace) == 0) @@ -457,6 +479,21 @@ namespace OpenSim.Region.Physics.OdePlugin resetSpaceArrayItemToZero(currentspace); } } + else + { + // this is a physical object that got disabled. ;.; + if (d.SpaceQuery(currentspace, geom)) + { + + d.SpaceRemove(currentspace, geom); + } + else + { + IntPtr sGeomIsIn = d.GeomGetSpace(geom); + if (sGeomIsIn != null) + d.SpaceRemove(sGeomIsIn, geom); + } + } // The routines in the Position and Size sections do the 'inserting' into the space, -- cgit v1.1