Merge branch 'master' of /home/opensim/var/repo/opensim

integration
BlueWall 2012-04-20 22:45:56 -04:00
commit 05b369965e
2 changed files with 132 additions and 120 deletions

View File

@ -1042,21 +1042,23 @@ Console.WriteLine("ZProcessTaints for " + Name);
/// <param name="prim">Child prim</param> /// <param name="prim">Child prim</param>
private void AddChildPrim(OdePrim prim) private void AddChildPrim(OdePrim prim)
{ {
//Console.WriteLine("AddChildPrim " + Name); if (LocalID == prim.LocalID)
if (LocalID != prim.LocalID) return;
{
if (Body == IntPtr.Zero) if (Body == IntPtr.Zero)
{ {
Body = d.BodyCreate(_parent_scene.world); Body = d.BodyCreate(_parent_scene.world);
setMass(); setMass();
} }
if (Body != IntPtr.Zero)
{
lock (childrenPrim) lock (childrenPrim)
{ {
if (!childrenPrim.Contains(prim)) if (childrenPrim.Contains(prim))
{ return;
//Console.WriteLine("childrenPrim.Add " + prim);
// m_log.DebugFormat(
// "[ODE PRIM]: Linking prim {0} {1} to {2} {3}", prim.Name, prim.LocalID, Name, LocalID);
childrenPrim.Add(prim); childrenPrim.Add(prim);
foreach (OdePrim prm in childrenPrim) foreach (OdePrim prm in childrenPrim)
@ -1165,19 +1167,21 @@ Console.WriteLine("ZProcessTaints for " + Name);
{ {
createAMotor(m_angularlock); createAMotor(m_angularlock);
} }
d.BodySetPosition(Body, Position.X, Position.Y, Position.Z); d.BodySetPosition(Body, Position.X, Position.Y, Position.Z);
if (m_vehicle.Type != Vehicle.TYPE_NONE) if (m_vehicle.Type != Vehicle.TYPE_NONE)
m_vehicle.Enable(Body, _parent_scene); m_vehicle.Enable(Body, _parent_scene);
_parent_scene.ActivatePrim(this); _parent_scene.ActivatePrim(this);
} }
} }
}
}
}
private void ChildSetGeom(OdePrim odePrim) private void ChildSetGeom(OdePrim odePrim)
{ {
// m_log.DebugFormat(
// "[ODE PRIM]: ChildSetGeom {0} {1} for {2} {3}", odePrim.Name, odePrim.LocalID, Name, LocalID);
//if (IsPhysical && Body != IntPtr.Zero) //if (IsPhysical && Body != IntPtr.Zero)
lock (childrenPrim) lock (childrenPrim)
{ {
@ -1192,12 +1196,14 @@ Console.WriteLine("ZProcessTaints for " + Name);
//prm.childPrim = false; //prm.childPrim = false;
} }
} }
disableBody(); disableBody();
if (Body != IntPtr.Zero) // Spurious - Body == IntPtr.Zero after disableBody()
{ // if (Body != IntPtr.Zero)
_parent_scene.DeactivatePrim(this); // {
} // _parent_scene.DeactivatePrim(this);
// }
lock (childrenPrim) lock (childrenPrim)
{ {
@ -1211,6 +1217,9 @@ Console.WriteLine("ZProcessTaints for " + Name);
private void ChildDelink(OdePrim odePrim) private void ChildDelink(OdePrim odePrim)
{ {
// m_log.DebugFormat(
// "[ODE PRIM]: Delinking prim {0} {1} from {2} {3}", odePrim.Name, odePrim.LocalID, Name, LocalID);
// Okay, we have a delinked child.. need to rebuild the body. // Okay, we have a delinked child.. need to rebuild the body.
lock (childrenPrim) lock (childrenPrim)
{ {
@ -1225,6 +1234,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
//prm.childPrim = false; //prm.childPrim = false;
} }
} }
disableBody(); disableBody();
lock (childrenPrim) lock (childrenPrim)
@ -1233,10 +1243,11 @@ Console.WriteLine("ZProcessTaints for " + Name);
childrenPrim.Remove(odePrim); childrenPrim.Remove(odePrim);
} }
if (Body != IntPtr.Zero) // Spurious - Body == IntPtr.Zero after disableBody()
{ // if (Body != IntPtr.Zero)
_parent_scene.DeactivatePrim(this); // {
} // _parent_scene.DeactivatePrim(this);
// }
lock (childrenPrim) lock (childrenPrim)
{ {

View File

@ -2226,7 +2226,8 @@ namespace OpenSim.Region.Physics.OdePlugin
/// <param name="prim"></param> /// <param name="prim"></param>
internal void RemovePrimThreadLocked(OdePrim prim) internal void RemovePrimThreadLocked(OdePrim prim)
{ {
//Console.WriteLine("RemovePrimThreadLocked " + prim.m_primName); // m_log.DebugFormat("[ODE SCENE]: Removing physical prim {0} {1}", prim.Name, prim.LocalID);
lock (prim) lock (prim)
{ {
RemoveCollisionEventReporting(prim); RemoveCollisionEventReporting(prim);