conflicts 4: the reckoning
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using Newtonsoft.Json;
|
||||
using LibNoise.Primitive;
|
||||
using Newtonsoft.Json;
|
||||
using Newtonsoft.Json.Linq;
|
||||
using System;
|
||||
using System.Globalization;
|
||||
@@ -109,10 +110,21 @@ namespace RH_Engine
|
||||
ReadPrefMessage(stream);
|
||||
string routeid = CreateRoute(stream, createGraphics);
|
||||
|
||||
WriteTextMessage(stream, createGraphics.RoadCommand(routeid));
|
||||
WriteTextMessage(stream, createGraphics.TerrainCommand(new int[] { 256, 256 }, null));
|
||||
Console.WriteLine(ReadPrefMessage(stream));
|
||||
string command;
|
||||
|
||||
//string groundId = GetId("GroundPlane", stream, createGraphics);
|
||||
//Console.WriteLine("ground id: " + groundId);
|
||||
command = createGraphics.AddBikeModel();
|
||||
|
||||
WriteTextMessage(stream, command);
|
||||
|
||||
Console.WriteLine(ReadPrefMessage(stream));
|
||||
|
||||
command = createGraphics.AddModel("car", "data\\customModels\\TeslaRoadster.fbx");
|
||||
|
||||
WriteTextMessage(stream, command);
|
||||
|
||||
Console.WriteLine(ReadPrefMessage(stream));
|
||||
|
||||
|
||||
|
||||
@@ -153,6 +165,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>
|
||||
/// gets all the children in the current scene
|
||||
/// </summary>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
|
||||
Reference in New Issue
Block a user