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


C# ISceneEntity.SetGroup方法代码示例

本文整理汇总了C#中ISceneEntity.SetGroup方法的典型用法代码示例。如果您正苦于以下问题:C# ISceneEntity.SetGroup方法的具体用法?C# ISceneEntity.SetGroup怎么用?C# ISceneEntity.SetGroup使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ISceneEntity的用法示例。


在下文中一共展示了ISceneEntity.SetGroup方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: CreateEntity

        public ISceneEntity CreateEntity(
            ISceneEntity baseEntity, UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
        {
            if (Array.IndexOf(creationCapabilities, (PCode) shape.PCode) < 0)
            {
                MainConsole.Instance.DebugFormat("[VEGETATION]: PCode {0} not handled by {1}", shape.PCode, Name);
                return null;
            }

            ISceneChildEntity rootPart = baseEntity.GetChildPart(baseEntity.UUID);

            // if grass or tree, make phantom
            //rootPart.TrimPermissions();
            rootPart.AddFlag(PrimFlags.Phantom);
            if (rootPart.Shape.PCode != (byte) PCode.Grass)
                AdaptTree(ref shape);

            m_scene.SceneGraph.AddPrimToScene(baseEntity);
            baseEntity.SetGroup(groupID, ownerID, true);
            baseEntity.ScheduleGroupUpdate(PrimUpdateFlags.ForcedFullUpdate);

            return baseEntity;
        }
开发者ID:QueenStarfinder,项目名称:WhiteCore-Dev,代码行数:23,代码来源:VegetationModule.cs

示例2: CreateEntity

        /// <summary>
        /// Create a tree entity
        /// </summary>
        /// <param name="sceneObject">Scene object.</param>
        /// <param name="ownerID"></param>
        /// <param name="groupID"></param>
        /// <param name="pos"></param>
        /// <param name="rot"></param>
        /// <param name="shape"></param>
        /// <returns>The tree entity created, or null if the creation failed</returns>
        public ISceneEntity CreateEntity(
            ISceneEntity sceneObject, UUID ownerID, UUID groupID, Vector3 pos, Quaternion rot, PrimitiveBaseShape shape)
        {
            if ( Array.IndexOf( creationCapabilities, ( PCode)shape.PCode ) < 0 )
            {
                MainConsole.Instance.Debug ( "[VEGETATION]: PCode " + shape.PCode + " not handled by "+ Name );
                return null;
            }

            ISceneChildEntity rootPart = sceneObject.GetChildPart(sceneObject.UUID);

            rootPart.AddFlag(PrimFlags.Phantom);
            if ( rootPart.Shape.PCode != (byte)PCode.Grass )
            {
                // Tree size has to be adapted depending on its type
                switch ( (Tree)rootPart.Shape.State )
                {
                    case Tree.Cypress1:
                    case Tree.Cypress2:
                    case Tree.Palm1:
                    case Tree.Palm2:
                    case Tree.WinterAspen:
                        rootPart.Scale = new Vector3(4, 4, 10);
                        break;
                    case Tree.WinterPine1:
                    case Tree.WinterPine2:
                        rootPart.Scale = new Vector3(4, 4, 20);
                        break;

                    case Tree.Dogwood:
                        rootPart.Scale = new Vector3(6.5f, 6.5f, 6.5f);
                        break;

                    // case... other tree types
                    // tree.Scale = new Vector3(?, ?, ?);
                    // break;
                    default:
                        rootPart.Scale = new Vector3(4, 4, 4);
                        break;
                }
            }

            sceneObject.SetGroup( groupID, UUID.Zero, false );
            m_scene.SceneGraph.AddPrimToScene( sceneObject );
            sceneObject.ScheduleGroupUpdate( PrimUpdateFlags.ForcedFullUpdate );

            return sceneObject;
        }
开发者ID:WhiteCoreSim,项目名称:WhiteCore-Optional-Modules,代码行数:58,代码来源:TreePopulatorModule.cs


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