Added medium debug information to Verbose mode of the console about Prim/space movements. Should help make sense of the copy prim bug. Use for Pastebin. :D

afrisby
Teravus Ovares 2007-11-19 03:06:17 +00:00
parent 694bab9513
commit 72525d3015
1 changed files with 72 additions and 7 deletions

View File

@ -168,7 +168,10 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
public string whichspaceamIin(PhysicsVector pos)
{
return calculateSpaceForGeom(pos).ToString();
}
private void near(IntPtr space, IntPtr g1, IntPtr g2) private void near(IntPtr space, IntPtr g1, IntPtr g2)
{ {
@ -412,8 +415,14 @@ namespace OpenSim.Region.Physics.OdePlugin
if (!(((OdePrim)prim).m_targetSpace.Equals(null))) if (!(((OdePrim)prim).m_targetSpace.Equals(null)))
{ {
if (d.GeomIsSpace(((OdePrim)prim).m_targetSpace)) if (d.GeomIsSpace(((OdePrim)prim).m_targetSpace))
{
d.SpaceRemove(((OdePrim)prim).m_targetSpace, ((OdePrim)prim).prim_geom); d.SpaceRemove(((OdePrim)prim).m_targetSpace, ((OdePrim)prim).prim_geom);
} }
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString());
}
}
} }
@ -430,6 +439,10 @@ namespace OpenSim.Region.Physics.OdePlugin
d.SpaceDestroy(((OdePrim)prim).m_targetSpace); d.SpaceDestroy(((OdePrim)prim).m_targetSpace);
resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position)); resetSpaceArrayItemToZero(calculateSpaceArrayItemFromPos(((OdePrim)prim).Position));
} }
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString());
}
} }
} }
} }
@ -468,17 +481,30 @@ namespace OpenSim.Region.Physics.OdePlugin
if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0) if (d.SpaceQuery(currentspace, geom) && currentspace != (IntPtr)0)
{ {
if (d.GeomIsSpace(currentspace)) if (d.GeomIsSpace(currentspace))
{
d.SpaceRemove(currentspace, geom); d.SpaceRemove(currentspace, geom);
} }
else else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString());
}
}
else
{ {
IntPtr sGeomIsIn = d.GeomGetSpace(geom); IntPtr sGeomIsIn = d.GeomGetSpace(geom);
if (!(sGeomIsIn.Equals(null))) if (!(sGeomIsIn.Equals(null)))
{ {
if (sGeomIsIn != (IntPtr)0) if (sGeomIsIn != (IntPtr)0)
if (d.GeomIsSpace(currentspace)) if (d.GeomIsSpace(currentspace))
{
d.SpaceRemove(sGeomIsIn, geom); d.SpaceRemove(sGeomIsIn, geom);
} }
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString());
}
}
} }
@ -494,6 +520,11 @@ namespace OpenSim.Region.Physics.OdePlugin
d.SpaceDestroy(currentspace); d.SpaceDestroy(currentspace);
resetSpaceArrayItemToZero(currentspace); resetSpaceArrayItemToZero(currentspace);
} }
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString());
}
} }
} }
} }
@ -503,9 +534,17 @@ namespace OpenSim.Region.Physics.OdePlugin
if (d.SpaceQuery(currentspace, geom)) if (d.SpaceQuery(currentspace, geom))
{ {
if (currentspace != (IntPtr)0) if (currentspace != (IntPtr)0)
if (d.GeomIsSpace(currentspace))
{
d.SpaceRemove(currentspace, geom); d.SpaceRemove(currentspace, geom);
} }
else else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString());
}
}
else
{ {
IntPtr sGeomIsIn = d.GeomGetSpace(geom); IntPtr sGeomIsIn = d.GeomGetSpace(geom);
if (!(sGeomIsIn.Equals(null))) if (!(sGeomIsIn.Equals(null)))
@ -513,8 +552,15 @@ namespace OpenSim.Region.Physics.OdePlugin
if (sGeomIsIn != (IntPtr)0) if (sGeomIsIn != (IntPtr)0)
{ {
if (d.GeomIsSpace(sGeomIsIn)) if (d.GeomIsSpace(sGeomIsIn))
{
d.SpaceRemove(sGeomIsIn, geom); d.SpaceRemove(sGeomIsIn, geom);
} }
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString());
}
}
} }
} }
} }
@ -1279,6 +1325,16 @@ namespace OpenSim.Region.Physics.OdePlugin
{ {
m_lastUpdateSent = true; m_lastUpdateSent = true;
base.RequestPhysicsterseUpdate(); base.RequestPhysicsterseUpdate();
string primScenAvatarIn = _parent_scene.whichspaceamIin(_position);
int arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
if (primScenAvatarIn == "0")
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in space with no prim. Arr:':" + arrayitem.ToString());
}
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in Prim space':" + primScenAvatarIn + ". Arr:" + arrayitem.ToString());
}
} }
} }
@ -1571,7 +1627,16 @@ namespace OpenSim.Region.Physics.OdePlugin
} }
else else
{ {
string primScenAvatarIn = _parent_scene.whichspaceamIin(_position);
int arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position);
if (primScenAvatarIn == "0")
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in space with no prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + " . Arr:': " + arrayitem.ToString());
}
else
{
OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in Prim space with prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + ". Arr:" + arrayitem.ToString());
}
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.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z);
d.SpaceAdd(m_targetSpace, prim_geom); d.SpaceAdd(m_targetSpace, prim_geom);