refactor: Rename ODEPrim.ParentPrim() to AddChildPrim() for code readability

bulletsim
Justin Clark-Casey (justincc) 2011-07-30 23:20:43 +01:00
parent 49a3740ee9
commit 4f4d080461
1 changed files with 14 additions and 11 deletions

View File

@ -778,6 +778,7 @@ namespace OpenSim.Region.Physics.OdePlugin
Body = IntPtr.Zero; Body = IntPtr.Zero;
} }
} }
m_disabled = true; m_disabled = true;
m_collisionscore = 0; m_collisionscore = 0;
} }
@ -968,7 +969,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
OdePrim obj = (OdePrim)m_taintparent; OdePrim obj = (OdePrim)m_taintparent;
//obj.disableBody(); //obj.disableBody();
//Console.WriteLine("changelink calls ParentPrim"); //Console.WriteLine("changelink calls ParentPrim");
obj.ParentPrim(this); obj.AddChildPrim(this);
/* /*
if (obj.Body != (IntPtr)0 && Body != (IntPtr)0 && obj.Body != Body) if (obj.Body != (IntPtr)0 && Body != (IntPtr)0 && obj.Body != Body)
@ -1008,11 +1009,13 @@ Console.WriteLine("ZProcessTaints for " + Name);
m_taintPhysics = m_isphysical; m_taintPhysics = m_isphysical;
} }
// I'm the parent /// <summary>
// prim is the child /// Add a child prim to this parent prim.
public void ParentPrim(OdePrim prim) /// </summary>
/// <param name="prim">Child prim</param>
public void AddChildPrim(OdePrim prim)
{ {
//Console.WriteLine("ParentPrim " + Name); //Console.WriteLine("AddChildPrim " + Name);
if (this.m_localID != prim.m_localID) if (this.m_localID != prim.m_localID)
{ {
if (Body == IntPtr.Zero) if (Body == IntPtr.Zero)
@ -1035,7 +1038,6 @@ Console.WriteLine("ZProcessTaints for " + Name);
d.MassSetZero(out m2); d.MassSetZero(out m2);
d.MassSetBoxTotal(out m2, prim.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z); d.MassSetBoxTotal(out m2, prim.CalculateMass(), prm._size.X, prm._size.Y, prm._size.Z);
d.Quaternion quat = new d.Quaternion(); d.Quaternion quat = new d.Quaternion();
quat.W = prm._orientation.W; quat.W = prm._orientation.W;
quat.X = prm._orientation.X; quat.X = prm._orientation.X;
@ -1105,6 +1107,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
prm.Body = Body; prm.Body = Body;
_parent_scene.addActivePrim(prm); _parent_scene.addActivePrim(prm);
} }
m_collisionCategories |= CollisionCategories.Body; m_collisionCategories |= CollisionCategories.Body;
m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
@ -1113,7 +1116,6 @@ Console.WriteLine("ZProcessTaints for " + Name);
//Console.WriteLine(" Post GeomSetCategoryBits 2"); //Console.WriteLine(" Post GeomSetCategoryBits 2");
d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
d.Quaternion quat2 = new d.Quaternion(); d.Quaternion quat2 = new d.Quaternion();
quat2.W = _orientation.W; quat2.W = _orientation.W;
quat2.X = _orientation.X; quat2.X = _orientation.X;
@ -1135,7 +1137,6 @@ Console.WriteLine("ZProcessTaints for " + Name);
d.BodySetAutoDisableFlag(Body, true); d.BodySetAutoDisableFlag(Body, true);
d.BodySetAutoDisableSteps(Body, body_autodisable_frames); d.BodySetAutoDisableSteps(Body, body_autodisable_frames);
m_interpenetrationcount = 0; m_interpenetrationcount = 0;
m_collisionscore = 0; m_collisionscore = 0;
m_disabled = false; m_disabled = false;
@ -1146,7 +1147,9 @@ 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) m_vehicle.Enable(Body, _parent_scene); if (m_vehicle.Type != Vehicle.TYPE_NONE)
m_vehicle.Enable(Body, _parent_scene);
_parent_scene.addActivePrim(this); _parent_scene.addActivePrim(this);
} }
} }
@ -1183,7 +1186,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
foreach (OdePrim prm in childrenPrim) foreach (OdePrim prm in childrenPrim)
{ {
//Console.WriteLine("ChildSetGeom calls ParentPrim"); //Console.WriteLine("ChildSetGeom calls ParentPrim");
ParentPrim(prm); AddChildPrim(prm);
} }
} }
@ -1223,7 +1226,7 @@ Console.WriteLine("ZProcessTaints for " + Name);
foreach (OdePrim prm in childrenPrim) foreach (OdePrim prm in childrenPrim)
{ {
//Console.WriteLine("ChildDelink calls ParentPrim"); //Console.WriteLine("ChildDelink calls ParentPrim");
ParentPrim(prm); AddChildPrim(prm);
} }
} }
} }