本文整理汇总了C#中OpenSim.Region.Framework.Scenes.SceneObjectGroup.GetPartCount方法的典型用法代码示例。如果您正苦于以下问题:C# SceneObjectGroup.GetPartCount方法的具体用法?C# SceneObjectGroup.GetPartCount怎么用?C# SceneObjectGroup.GetPartCount使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.SceneObjectGroup
的用法示例。
在下文中一共展示了SceneObjectGroup.GetPartCount方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AddObject
// NOTE: Call under Taint Lock
private void AddObject(SceneObjectGroup obj)
{
if (obj.IsAttachment)
return;
if (((obj.RootPart.Flags & PrimFlags.TemporaryOnRez) != 0))
return;
Vector3 pos = obj.AbsolutePosition;
ILandObject landObject = m_Scene.LandChannel.GetLandObject(pos.X, pos.Y);
// If for some reason there is no land object (perhaps the object is out of bounds) then we can't count it
if (landObject == null)
{
// m_log.WarnFormat(
// "[PRIM COUNT MODULE]: Found no land object for {0} at position ({1}, {2}) on {3}",
// obj.Name, pos.X, pos.Y, m_Scene.RegionInfo.RegionName);
return;
}
LandData landData = landObject.LandData;
// m_log.DebugFormat(
// "[PRIM COUNT MODULE]: Adding object {0} with {1} parts to prim count for parcel {2} on {3}",
// obj.Name, obj.Parts.Length, landData.Name, m_Scene.RegionInfo.RegionName);
// m_log.DebugFormat(
// "[PRIM COUNT MODULE]: Object {0} is owned by {1} over land owned by {2}",
// obj.Name, obj.OwnerID, landData.OwnerID);
ParcelCounts parcelCounts;
if (m_ParcelCounts.TryGetValue(landData.GlobalID, out parcelCounts))
{
UUID landOwner = landData.OwnerID;
int partCount = obj.GetPartCount();
m_SimwideCounts[landOwner] += partCount;
if (parcelCounts.Users.ContainsKey(obj.OwnerID))
parcelCounts.Users[obj.OwnerID] += partCount;
else
parcelCounts.Users[obj.OwnerID] = partCount;
if (obj.IsSelected)
{
parcelCounts.Selected += partCount;
}
else
{
if (landData.IsGroupOwned)
{
if (obj.OwnerID == landData.GroupID)
parcelCounts.Owner += partCount;
else if (landData.GroupID != UUID.Zero && obj.GroupID == landData.GroupID)
parcelCounts.Group += partCount;
else
parcelCounts.Others += partCount;
}
else
{
if (obj.OwnerID == landData.OwnerID)
parcelCounts.Owner += partCount;
else
parcelCounts.Others += partCount;
}
}
}
}