* Tentative Bug fix for OptikSL's intermittant Copy prim error.
parent
615b40b68b
commit
7672237bcd
|
@ -179,7 +179,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// We'll be calling near recursivly if one
|
// We'll be calling near recursivly if one
|
||||||
// of them is a space to find all of the
|
// of them is a space to find all of the
|
||||||
// contact points in the space
|
// contact points in the space
|
||||||
|
|
||||||
d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
|
d.SpaceCollide2(g1, g2, IntPtr.Zero, nearCallback);
|
||||||
//Colliding a space or a geom with a space or a geom.
|
//Colliding a space or a geom with a space or a geom.
|
||||||
|
|
||||||
|
@ -199,8 +199,6 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
|
|
||||||
if (g1 == g2)
|
if (g1 == g2)
|
||||||
return; // Can't collide with yourself
|
return; // Can't collide with yourself
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
|
if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
|
||||||
return;
|
return;
|
||||||
|
@ -457,7 +455,7 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// never be called if the prim is physical(active)
|
// never be called if the prim is physical(active)
|
||||||
if (currentspace != space)
|
if (currentspace != space)
|
||||||
{
|
{
|
||||||
if (d.SpaceQuery(currentspace, geom))
|
if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0)
|
||||||
{
|
{
|
||||||
|
|
||||||
d.SpaceRemove(currentspace, geom);
|
d.SpaceRemove(currentspace, geom);
|
||||||
|
@ -466,17 +464,23 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
{
|
{
|
||||||
IntPtr sGeomIsIn = d.GeomGetSpace(geom);
|
IntPtr sGeomIsIn = d.GeomGetSpace(geom);
|
||||||
if (!(sGeomIsIn.Equals(null)))
|
if (!(sGeomIsIn.Equals(null)))
|
||||||
d.SpaceRemove(sGeomIsIn, geom);
|
{
|
||||||
|
if (sGeomIsIn != (IntPtr)0)
|
||||||
|
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 there are no more geometries in the sub-space, we don't need it in the main space anymore
|
||||||
if (d.SpaceGetNumGeoms(currentspace) == 0)
|
if (d.SpaceGetNumGeoms(currentspace) == 0)
|
||||||
{
|
{
|
||||||
d.SpaceRemove(space, currentspace);
|
if (currentspace != (IntPtr)0)
|
||||||
// free up memory used by the space.
|
{
|
||||||
d.SpaceDestroy(currentspace);
|
d.SpaceRemove(space, currentspace);
|
||||||
resetSpaceArrayItemToZero(currentspace);
|
// free up memory used by the space.
|
||||||
|
d.SpaceDestroy(currentspace);
|
||||||
|
resetSpaceArrayItemToZero(currentspace);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -484,14 +488,19 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
// this is a physical object that got disabled. ;.;
|
// this is a physical object that got disabled. ;.;
|
||||||
if (d.SpaceQuery(currentspace, geom))
|
if (d.SpaceQuery(currentspace, geom))
|
||||||
{
|
{
|
||||||
|
if (currentspace != (IntPtr)0)
|
||||||
d.SpaceRemove(currentspace, geom);
|
d.SpaceRemove(currentspace, geom);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
IntPtr sGeomIsIn = d.GeomGetSpace(geom);
|
IntPtr sGeomIsIn = d.GeomGetSpace(geom);
|
||||||
if (!(sGeomIsIn.Equals(null)))
|
if (!(sGeomIsIn.Equals(null)))
|
||||||
d.SpaceRemove(sGeomIsIn, geom);
|
{
|
||||||
|
if (sGeomIsIn != (IntPtr)0)
|
||||||
|
{
|
||||||
|
d.SpaceRemove(sGeomIsIn, geom);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1547,8 +1556,9 @@ namespace OpenSim.Region.Physics.OdePlugin
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
|
||||||
m_targetSpace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace);
|
m_targetSpace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace);
|
||||||
|
d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
|
||||||
d.SpaceAdd(m_targetSpace, prim_geom);
|
d.SpaceAdd(m_targetSpace, prim_geom);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue