本文整理汇总了C#中OpenSim.Region.Physics.OdePlugin.OdePrim.DestroyBody方法的典型用法代码示例。如果您正苦于以下问题:C# OdePrim.DestroyBody方法的具体用法?C# OdePrim.DestroyBody怎么用?C# OdePrim.DestroyBody使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Physics.OdePlugin.OdePrim
的用法示例。
在下文中一共展示了OdePrim.DestroyBody方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: ParentPrim
/// <summary>
/// Add a child prim to this parent prim.
/// </summary>
/// <param name="prim">Child prim</param>
// I'm the parent
// prim is the child
public void ParentPrim(OdePrim prim)
{
//Console.WriteLine("ParentPrim " + m_primName);
if (this.m_localID != prim.m_localID)
{
DestroyBody(); // for now we need to rebuil entire object on link change
lock (childrenPrim)
{
// adopt the prim
if (!childrenPrim.Contains(prim))
childrenPrim.Add(prim);
// see if this prim has kids and adopt them also
// should not happen for now
foreach (OdePrim prm in prim.childrenPrim)
{
if (!childrenPrim.Contains(prm))
{
if (prm.Body != IntPtr.Zero)
{
if (prm.prim_geom != IntPtr.Zero)
d.GeomSetBody(prm.prim_geom, IntPtr.Zero);
if(prm.Body != prim.Body)
prm.DestroyBody(); // don't loose bodies around
prm.Body = IntPtr.Zero;
}
childrenPrim.Add(prm);
prm._parent = this;
}
}
}
//Remove old children from the prim
prim.childrenPrim.Clear();
prim.childPrim = true;
prim._parent = this;
if (prim.Body != IntPtr.Zero)
{
if (prim.prim_geom != IntPtr.Zero)
d.GeomSetBody(prim.prim_geom, IntPtr.Zero);
prim.DestroyBody(); // don't loose bodies around
prim.Body = IntPtr.Zero;
}
MakeBody(); // full nasty reconstruction
}
}