From f6c2b3c662a405ebfec46c8f72d7e4ccd4cefe22 Mon Sep 17 00:00:00 2001 From: Logophilist Date: Wed, 7 Oct 2020 11:51:02 +0200 Subject: [PATCH] Panel fixed --- RH-Engine/Command.cs | 15 ++++++++++++++- RH-Engine/Program.cs | 28 +++------------------------- 2 files changed, 17 insertions(+), 26 deletions(-) diff --git a/RH-Engine/Command.cs b/RH-Engine/Command.cs index 110965f..3875448 100644 --- a/RH-Engine/Command.cs +++ b/RH-Engine/Command.cs @@ -106,8 +106,21 @@ namespace RH_Engine data = new { name = "dashboard", + parent = uuidBike, components = new { + transform = new + { + position = new float[] + { + -1.5f, 1f, 0f + }, + scale = 1, + rotation = new int[] + { + -30, 90,0 + } + }, panel = new { size = new int[] { 1, 1 }, @@ -130,7 +143,7 @@ namespace RH_Engine data = new { id = uuidPanel, - color = new int[] { 1, 1, 1, 1 } + color = new float[] { 0f, 0f, 0f, 0f } } }; diff --git a/RH-Engine/Program.cs b/RH-Engine/Program.cs index 52c29a6..bfac8c8 100644 --- a/RH-Engine/Program.cs +++ b/RH-Engine/Program.cs @@ -179,6 +179,7 @@ namespace RH_Engine bool speedReplied = false; bool moveReplied = true; panelId = JSONParser.getPanelID(message); + WriteTextMessage(stream, mainCommand.ColorPanel(panelId)); WriteTextMessage(stream, mainCommand.ClearPanel(panelId)); @@ -186,6 +187,7 @@ namespace RH_Engine (message) => { Console.WriteLine(message); + SendMessageAndOnResponse(stream, mainCommand.bikeSpeed(panelId, "bikeSpeed", 5.0), "bikeSpeed", (message) => { @@ -223,31 +225,7 @@ namespace RH_Engine //WriteTextMessage(stream, mainCommand.TerrainCommand(new int[] { 256, 256 }, null)); //string command; - - - -<<<<<<< HEAD - //Console.WriteLine("id of head " + GetId(Command.STANDARD_HEAD, stream, mainCommand)); - - //command = mainCommand.AddModel("car", "data\\customModels\\TeslaRoadster.fbx"); - //WriteTextMessage(stream, command); - - //command = mainCommand.addPanel(); - // WriteTextMessage(stream, command); - // string response = ReadPrefMessage(stream); - // Console.WriteLine("add Panel response: \n\r" + response); - // string uuidPanel = JSONParser.getPanelID(response); - // WriteTextMessage(stream, mainCommand.ClearPanel(uuidPanel)); - // Console.WriteLine(ReadPrefMessage(stream)); - // WriteTextMessage(stream, mainCommand.bikeSpeed(uuidPanel, 2.42)); - // Console.WriteLine(ReadPrefMessage(stream)); - // WriteTextMessage(stream, mainCommand.ColorPanel(uuidPanel)); - // Console.WriteLine("Color panel: " + ReadPrefMessage(stream)); - // WriteTextMessage(stream, mainCommand.SwapPanel(uuidPanel)); - // Console.WriteLine("Swap panel: " + ReadPrefMessage(stream)); -======= Console.WriteLine("id of head " + GetId(Command.STANDARD_HEAD, stream, mainCommand)); ->>>>>>> develop } /// @@ -330,7 +308,7 @@ namespace RH_Engine { WriteTextMessage(stream, mainCommand.RouteFollow(routeId, bikeId, speed, new float[] { 0, -(float)Math.PI / 2f, 0 }, new float[] { 0, 0, 0 })); WriteTextMessage(stream, mainCommand.RouteFollow(routeId, cameraId, speed)); - WriteTextMessage(stream, mainCommand.RouteFollow(routeId, panelId, speed, 0, "XYZ", 1, false, new float[] { 0, 0, 0 }, new float[] { 0f, 0f, 150f })); + //WriteTextMessage(stream, mainCommand.RouteFollow(routeId, panelId, speed, 1f, "XYZ", 1, false, new float[] { 0, 0, 0 }, new float[] { 0f, 5f, 5f })); } //string routeID, string nodeID, float speedValue, float offsetValue, string rotateValue, float smoothingValue, bool followHeightValue, float[] rotateOffsetVector, float[] positionOffsetVector) private static void Force(NetworkStream stream, string message, string serial, HandleSerial action)