diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index f1c7a66437..03b22aed08 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,