This commit is contained in:
fabjuuuh
2020-09-18 16:01:39 +02:00
parent 037bb8a6cf
commit de7f667dd0
3 changed files with 26 additions and 16 deletions

View File

@@ -23,7 +23,7 @@ namespace RH_Engine
this.tunnelID = tunnelID; this.tunnelID = tunnelID;
} }
public string TerrainCommand(int[] sizeArray, int[] heightsArray) public string TerrainCommand(int[] sizeArray, float[] heightsArray)
{ {
dynamic payload = new dynamic payload = new
{ {

View File

@@ -1,4 +1,5 @@
using Newtonsoft.Json; using LibNoise.Primitive;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq; using Newtonsoft.Json.Linq;
using System; using System;
using System.IO; using System.IO;
@@ -13,15 +14,15 @@ namespace RH_Engine
internal class Program internal class Program
{ {
private static PC[] PCs = { private static PC[] PCs = {
new PC("DESKTOP-TV73FK0", "woute"), //new PC("DESKTOP-TV73FK0", "woute"),
new PC("DESKTOP-M2CIH87", "Fabian"),
//new PC("T470S", "Shinichi"),
//new PC("DESKTOP-DHS478C", "semme"),
//new PC("NA", "Ralf"),
//new PC("NA", "Bart"),
//new PC("DESKTOP-M2CIH87", "Fabian"), //new PC("DESKTOP-M2CIH87", "Fabian"),
//new PC("T470S", "Shinichi"), //new PC("T470S", "Shinichi"),
//new PC("DESKTOP-DHS478C", "semme"), //new PC("DESKTOP-DHS478C", "semme"),
new PC("NA", "Ralf"),
new PC("NA", "Bart"),
//new PC("DESKTOP-M2CIH87", "Fabian"),
//new PC("T470S", "Shinichi"),
new PC("DESKTOP-DHS478C", "semme"),
//new PC("DESKTOP-TV73FKO", "Wouter"), //new PC("DESKTOP-TV73FKO", "Wouter"),
//new PC("NA", "Ralf"), //new PC("NA", "Ralf"),
//new PC("NA", "Bart") //new PC("NA", "Bart")
@@ -103,24 +104,32 @@ namespace RH_Engine
command = createGraphics.SkyboxCommand(DateTime.Now.Millisecond % 24); command = createGraphics.SkyboxCommand(DateTime.Now.Millisecond % 24);
Console.WriteLine("tunnelID is: " + tunnelID); Console.WriteLine("tunnelID is: " + tunnelID);
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 }, null)); WriteTextMessage(stream, createGraphics.TerrainCommand(new int[] { 256, 256 }, height));
Console.WriteLine(ReadPrefMessage(stream)); Console.WriteLine(ReadPrefMessage(stream));
WriteTextMessage(stream, createGraphics.AddNodeCommand()); WriteTextMessage(stream, createGraphics.AddNodeCommand());
Console.WriteLine(ReadPrefMessage(stream)); Console.WriteLine(ReadPrefMessage(stream));
command = createGraphics.AddBikeModel(); //command = createGraphics.AddBikeModel();
WriteTextMessage(stream, command); //WriteTextMessage(stream, command);
Console.WriteLine(ReadPrefMessage(stream)); //Console.WriteLine(ReadPrefMessage(stream));
command = createGraphics.AddModel("car", "data\\customModels\\TeslaRoadster.fbx"); //command = createGraphics.AddModel("car", "data\\customModels\\TeslaRoadster.fbx");
WriteTextMessage(stream, command); //WriteTextMessage(stream, command);
Console.WriteLine(ReadPrefMessage(stream)); //Console.WriteLine(ReadPrefMessage(stream));

View File

@@ -1,4 +1,4 @@
<Project Sdk="Microsoft.NET.Sdk"> <Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
@@ -7,6 +7,7 @@
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="LibNoise" Version="0.2.0" />
<PackageReference Include="Newtonsoft.Json" Version="12.0.3" /> <PackageReference Include="Newtonsoft.Json" Version="12.0.3" />
</ItemGroup> </ItemGroup>