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


C# Simulator.TerrainHeightAtPoint方法代码示例

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


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

示例1: Terraform

        /// <summary>
        /// Terraform (raise, lower, etc) an area or whole parcel of land
        /// </summary>
        /// <param name="simulator">Simulator land area is in.</param>
        /// <param name="localID">LocalID of parcel, or -1 if using bounding box</param>
        /// <param name="west">west border of area to modify</param>
        /// <param name="south">south border of area to modify</param>
        /// <param name="east">east border of area to modify</param>
        /// <param name="north">north border of area to modify</param>
        /// <param name="action">From Enum, Raise, Lower, Level, Smooth, Etc.</param>
        /// <param name="brushSize">Size of area to modify</param>
        /// <param name="seconds">How many meters + or - to lower, 1 = 1 meter</param>
        /// <returns>true on successful request sent.</returns>
        /// <remarks>Settings.STORE_LAND_PATCHES must be true, 
        /// Parcel information must be downloaded using <code>RequestAllSimParcels()</code></remarks>
        public bool Terraform(Simulator simulator, int localID, float west, float south, float east, float north,
            TerraformAction action, TerraformBrushSize brushSize, int seconds)
        {
            float height = 0f;
            int x, y;
            if (localID == -1)
            {
                x = (int)east - (int)west / 2;
                y = (int)north - (int)south / 2;
            }
            else
            {
                Parcel p;
                if (!simulator.Parcels.TryGetValue(localID, out p))
                {
                    Logger.Log(String.Format("Can't find parcel {0} in simulator {1}", localID, simulator),
                        Helpers.LogLevel.Warning, Client);
                    return false;
                }

                x = (int)p.AABBMax.X - (int)p.AABBMin.X / 2;
                y = (int)p.AABBMax.Y - (int)p.AABBMin.Y / 2;
            }

            if (!simulator.TerrainHeightAtPoint(x, y, out height))
            {
                Logger.Log("Land Patch not stored for location", Helpers.LogLevel.Warning, Client);
                return false;
            }

            Terraform(simulator, localID, west, south, east, north, action, brushSize, seconds, height);
            return true;
        }
开发者ID:RavenB,项目名称:gridsearch,代码行数:48,代码来源:ParcelManager.cs

示例2: SaveTerrainStream

        private static void SaveTerrainStream(Stream s, Simulator sim)
        {
            BinaryWriter bs = new BinaryWriter(s);
            
            int y;
            for (y = 0; y < 256; y++)
            {
                int x;
                for (x = 0; x < 256; x++)
                {
                    float height;
                    sim.TerrainHeightAtPoint(x, y, out height);
                    bs.Write(height);
                }
            }

            bs.Close();
        }
开发者ID:skidzTweak,项目名称:Aurora-Sim-3rdparty-Addon-Modules,代码行数:18,代码来源:OarFile.cs


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