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


C# ITerrainChannel.GetDoubles方法代码示例

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


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

示例1: LoadWorldWaterMap

        /// <summary>
        /// Loads the World heightmap
        /// </summary>
        public void LoadWorldWaterMap()
        {
            if (!m_use3DWater)
                return;
            try
            {
                double[,] map = m_scene.SimulationDataService.LoadWater(m_scene.RegionInfo.RegionID, false, m_scene.RegionInfo.RegionSizeX, m_scene.RegionInfo.RegionSizeY);
                if (map == null)
                {
                    m_log.Info("[TERRAIN]: No default water. Generating a new water.");
                    m_waterChannel = new TerrainChannel(m_scene);

                    m_scene.SimulationDataService.StoreWater(m_waterChannel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
                }
                else
                {
                    m_channel = new TerrainChannel(map, m_scene);
                }
            }
            catch (IOException e)
            {
                m_log.Warn("[TERRAIN]: LoadWorldWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                // Non standard region size.    If there's an old terrain in the database, it might read past the buffer
                if (m_scene.RegionInfo.RegionSizeX != Constants.RegionSize || m_scene.RegionInfo.RegionSizeY != Constants.RegionSize)
                {
                    m_waterChannel = new TerrainChannel(m_scene);

                    m_scene.SimulationDataService.StoreWater(m_waterChannel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
                }
            }
            catch (IndexOutOfRangeException e)
            {
                m_log.Warn("[TERRAIN]: LoadWorldWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                m_waterChannel = new TerrainChannel(m_scene);

                m_scene.SimulationDataService.StoreWater(m_waterChannel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
            }
            catch (ArgumentOutOfRangeException e)
            {
                m_log.Warn("[TERRAIN]: LoadWorldWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                m_waterChannel = new TerrainChannel(m_scene);

                m_scene.SimulationDataService.StoreWater(m_waterChannel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
            }
            catch (Exception e)
            {
                m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
                m_waterChannel = new TerrainChannel(m_scene);

                m_scene.SimulationDataService.StoreWater(m_waterChannel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
            }
            LoadRevertWaterMap();
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:56,代码来源:TerrainModule.cs

示例2: LoadRevertWaterMap

        /// <summary>
        /// Loads the World Revert heightmap
        /// </summary>
        public void LoadRevertWaterMap()
        {
            try
            {
                double[,] map = m_scene.SimulationDataService.LoadWater(m_scene.RegionInfo.RegionID, true, m_scene.RegionInfo.RegionSizeX, m_scene.RegionInfo.RegionSizeY);
                if (map == null)
                {
                    m_waterRevert = m_waterChannel.MakeCopy();

                    m_scene.SimulationDataService.StoreWater(m_waterRevert.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, true);
                }
                else
                {
                    m_waterRevert = new TerrainChannel(map, m_scene);
                }
            }
            catch (IOException e)
            {
                m_log.Warn("[TERRAIN]: LoadRevertWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                // Non standard region size.    If there's an old terrain in the database, it might read past the buffer
                if (m_scene.RegionInfo.RegionSizeX != Constants.RegionSize || m_scene.RegionInfo.RegionSizeY != Constants.RegionSize)
                {
                    m_waterRevert = m_waterChannel.MakeCopy();

                    m_scene.SimulationDataService.StoreWater(m_waterRevert.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, true);
                }
            }
            catch (IndexOutOfRangeException e)
            {
                m_log.Warn("[TERRAIN]: LoadRevertWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                m_waterRevert = m_waterChannel.MakeCopy();

                m_scene.SimulationDataService.StoreWater(m_waterRevert.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, true);
            }
            catch (ArgumentOutOfRangeException e)
            {
                m_log.Warn("[TERRAIN]: LoadRevertWaterMap() - Failed with exception " + e.ToString() + " Regenerating");
                m_waterRevert = m_waterChannel.MakeCopy();

                m_scene.SimulationDataService.StoreWater(m_waterRevert.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, true);
            }
            catch (Exception e)
            {
                m_log.Warn("[TERRAIN]: LoadRevertWaterMap() - Failed with exception " + e.ToString());
                m_waterRevert = m_waterChannel.MakeCopy();

                m_scene.SimulationDataService.StoreWater(m_waterRevert.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, true);
            }
        }
开发者ID:mugginsm,项目名称:Aurora-Sim,代码行数:52,代码来源:TerrainModule.cs

示例3: SaveRevertTerrain

 /// <summary>
 /// Store the revert terrain in the persistant data store
 /// </summary>
 public void SaveRevertTerrain(ITerrainChannel channel)
 {
     SimulationDataService.StoreTerrain(channel.GetDoubles(), RegionInfo.RegionID, true);
 }
开发者ID:shangcheng,项目名称:Aurora,代码行数:7,代码来源:Scene.cs

示例4: applyModification

        protected void applyModification(ITerrainChannel map, TerrainModifierData data)
        {
            bool[,] mask;
            int xMax;
            int yMax;
            int xMid;
            int yMid;
            if (data.shape == "ellipse")
            {
                mask = this.ellipticalMask(data.dx, data.dy);
                xMax = mask.GetLength(0);
                yMax = mask.GetLength(1);
                xMid = xMax / 2 + xMax % 2;
                yMid = yMax / 2 + yMax % 2;
            }
            else
            {
                mask = this.rectangularMask(data.dx, data.dy);
                xMax = mask.GetLength(0);
                yMax = mask.GetLength(1);
                xMid = 0;
                yMid = 0;
            }
//            m_log.DebugFormat("Apply {0} mask {1}x{2} @ {3},{4}", data.shape, xMax, yMax, xMid, yMid);
            double[,] buffer = map.GetDoubles();
            int yDim = yMax;
            while(--yDim >= 0)
            {
                int yPos = data.y0 + yDim - yMid;
                if ((yPos >= 0) && (yPos < map.Height))
                {
                    int xDim = xMax;
                    while(--xDim >= 0)
                    {
                        int xPos = data.x0 + xDim - xMid;
                        if ((xPos >= 0) && (xPos < map.Width) && (mask[xDim, yDim]))
                        {
                            double endElevation = this.operate(buffer, data, xPos, yPos);
                            map[xPos, yPos] = endElevation;
                        }
                    }
                }
            }
        }
开发者ID:RadaSangOn,项目名称:workCore2,代码行数:44,代码来源:TerrainModifier.cs

示例5: LoadWorldHeightmap

        /// <summary>
        /// Loads the World heightmap
        /// </summary>
        public void LoadWorldHeightmap()
        {
            try
            {
                double[,] map = m_scene.SimulationDataService.LoadTerrain(m_scene.RegionInfo.RegionID, false);
                if (map == null)
                {
                    m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
                    m_channel = new TerrainChannel(m_scene);

                    m_scene.SimulationDataService.StoreTerrain(m_channel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
                }
                else
                {
                    m_channel = new TerrainChannel(map, m_scene);
                }
            }
            catch (IOException e)
            {
                m_log.Warn("[TERRAIN]: LoadWorldMap() - Failed with exception " + e.ToString() + " Regenerating");
#pragma warning disable 0162
                // Non standard region size.    If there's an old terrain in the database, it might read past the buffer
                if ((int)Constants.RegionSize != 256)
                {
                    m_channel = new TerrainChannel(m_scene);

                    m_scene.SimulationDataService.StoreTerrain(m_channel.GetDoubles(m_scene), m_scene.RegionInfo.RegionID, false);
                }
#pragma warning restore 0162
            }
            catch (Exception e)
            {
                m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
            }
            m_scene.RegisterModuleInterface<ITerrainChannel>(m_channel);
        }
开发者ID:KristenMynx,项目名称:Aurora-Sim,代码行数:39,代码来源:TerrainModule.cs


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