本文整理汇总了C#中OpenSim.Region.Framework.Scenes.TerrainChannel.GetDoubles方法的典型用法代码示例。如果您正苦于以下问题:C# TerrainChannel.GetDoubles方法的具体用法?C# TerrainChannel.GetDoubles怎么用?C# TerrainChannel.GetDoubles使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OpenSim.Region.Framework.Scenes.TerrainChannel
的用法示例。
在下文中一共展示了TerrainChannel.GetDoubles方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TerrainChannelTest
public void TerrainChannelTest()
{
TerrainChannel x = new TerrainChannel((int)Constants.RegionSize, (int)Constants.RegionSize);
Assert.That(x[0, 0] == 0.0, "Terrain not initialising correctly.");
x[0, 0] = 1.0;
Assert.That(x[0, 0] == 1.0, "Terrain not setting values correctly.");
x[0, 0] = 0;
x[0, 0] += 5.0;
x[0, 0] -= 1.0;
Assert.That(x[0, 0] == 4.0, "Terrain addition/subtraction error.");
x[0, 0] = Math.PI;
double[,] doublesExport = x.GetDoubles();
Assert.That(doublesExport[0, 0] == Math.PI, "Export to double[,] array not working correctly.");
x[0, 0] = 1.0;
float[] floatsExport = x.GetFloatsSerialised();
Assert.That(floatsExport[0] == 1.0f, "Export to float[] not working correctly.");
x[0, 0] = 1.0;
Assert.That(x.Tainted(0, 0), "Terrain channel tainting not working correctly.");
Assert.That(!x.Tainted(0, 0), "Terrain channel tainting not working correctly.");
TerrainChannel y = x.Copy();
Assert.That(!ReferenceEquals(x, y), "Terrain copy not duplicating correctly.");
Assert.That(!ReferenceEquals(x.GetDoubles(), y.GetDoubles()), "Terrain array not duplicating correctly.");
}
示例2: LoadWorldMap
/// <summary>
/// Loads the World heightmap
/// </summary>
public override void LoadWorldMap()
{
try
{
double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID);
if (map == null)
{
// This should be in the Terrain module, but it isn't because
// the heightmap is needed _way_ before the modules are initialized...
IConfig terrainConfig = m_config.Configs["Terrain"];
String m_InitialTerrain = "pinhead-island";
if (terrainConfig != null)
m_InitialTerrain = terrainConfig.GetString("InitialTerrain", m_InitialTerrain);
m_log.InfoFormat("[TERRAIN]: No default terrain. Generating a new terrain {0}.", m_InitialTerrain);
Heightmap = new TerrainChannel(m_InitialTerrain);
SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
else
{
Heightmap = new TerrainChannel(map);
}
}
catch (IOException e)
{
m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}",
e.Message, e.StackTrace);
// Non standard region size. If there's an old terrain in the database, it might read past the buffer
#pragma warning disable 0162
if ((int)Constants.RegionSize != 256)
{
Heightmap = new TerrainChannel();
SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
}
catch (Exception e)
{
m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace);
}
}
示例3: LoadWorldMap
/// <summary>
/// Loads the World heightmap
/// </summary>
public override void LoadWorldMap()
{
try
{
double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID);
if (map == null)
{
m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
Heightmap = new TerrainChannel();
m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
else
{
Heightmap = new TerrainChannel(map);
}
}
catch (Exception e)
{
m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
}
}
示例4: LoadWorldMap
/// <summary>
/// Loads the World heightmap
/// </summary>
public override void LoadWorldMap()
{
try
{
double[,] map = SimulationDataService.LoadTerrain(RegionInfo.RegionID);
if (map == null)
{
m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
Heightmap = new TerrainChannel();
SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
else
{
Heightmap = new TerrainChannel(map);
}
}
catch (IOException e)
{
m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Regenerating as failed with exception {0}{1}",
e.Message, e.StackTrace);
// Non standard region size. If there's an old terrain in the database, it might read past the buffer
#pragma warning disable 0162
if ((int)Constants.RegionSize != 256)
{
Heightmap = new TerrainChannel();
SimulationDataService.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
}
catch (Exception e)
{
m_log.WarnFormat(
"[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception {0}{1}", e.Message, e.StackTrace);
}
}
示例5: LoadWorldMap
/// <summary>
/// Loads the World heightmap
/// </summary>
public override void LoadWorldMap()
{
try
{
double[,] map = m_storageManager.DataStore.LoadTerrain(RegionInfo.RegionID);
if (map == null)
{
m_log.Info("[TERRAIN]: No default terrain. Generating a new terrain.");
Heightmap = new TerrainChannel();
m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
else
{
Heightmap = new TerrainChannel(map);
}
}
catch (IOException e)
{
m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - 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
#pragma warning disable 0162
if ((int)Constants.RegionSize != 256)
{
Heightmap = new TerrainChannel();
m_storageManager.DataStore.StoreTerrain(Heightmap.GetDoubles(), RegionInfo.RegionID);
}
}
catch (Exception e)
{
m_log.Warn("[TERRAIN]: Scene.cs: LoadWorldMap() - Failed with exception " + e.ToString());
}
}