当前位置: 首页>>代码示例>>C#>>正文


C# SceneObjectGroup.GetPartCount方法代码示例

本文整理汇总了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;
                    }
                }
            }
        }
开发者ID:CassieEllen,项目名称:opensim,代码行数:68,代码来源:PrimCountModule.cs


注:本文中的OpenSim.Region.Framework.Scenes.SceneObjectGroup.GetPartCount方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。