Made method for terrain no longer in createconnection
This commit is contained in:
@@ -119,7 +119,7 @@ namespace RH_Engine
|
|||||||
|
|
||||||
WriteTextMessage(stream, createGraphics.TerrainCommand(new int[] { 256, 256 }, null));
|
WriteTextMessage(stream, createGraphics.TerrainCommand(new int[] { 256, 256 }, null));
|
||||||
Console.WriteLine(ReadPrefMessage(stream));
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
string command;
|
||||||
|
|
||||||
command = createGraphics.AddBikeModel();
|
command = createGraphics.AddBikeModel();
|
||||||
|
|
||||||
@@ -172,6 +172,24 @@ namespace RH_Engine
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void CreateTerrain(NetworkStream stream, CreateGraphics createGraphics)
|
||||||
|
{
|
||||||
|
float x = 0f;
|
||||||
|
float[] height = new float[256 * 256];
|
||||||
|
ImprovedPerlin improvedPerlin = new ImprovedPerlin(0, LibNoise.NoiseQuality.Best);
|
||||||
|
for (int i = 0; i < 256 * 256; i++)
|
||||||
|
{
|
||||||
|
height[i] = improvedPerlin.GetValue(x / 10, x / 10, x * 100) + 1;
|
||||||
|
x += 0.001f;
|
||||||
|
}
|
||||||
|
|
||||||
|
WriteTextMessage(stream, createGraphics.TerrainCommand(new int[] { 256, 256 }, height));
|
||||||
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
|
||||||
|
WriteTextMessage(stream, createGraphics.AddNodeCommand());
|
||||||
|
Console.WriteLine(ReadPrefMessage(stream));
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// gets all the children in the current scene
|
/// gets all the children in the current scene
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user