* 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.

afrisby
Teravus Ovares 2007-11-17 20:34:56 +00:00
parent 5460ba79dc
commit 8a57dd207f
1 changed files with 37 additions and 0 deletions

View File

@ -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,