From 17eb3b184568d91e5a71cb51390e89f0ecc2605a Mon Sep 17 00:00:00 2001 From: shinichi Date: Fri, 18 Sep 2020 15:39:30 +0200 Subject: [PATCH] added positions for models --- RH-Engine/CreateGraphics.cs | 25 +++++++++++++++++++------ 1 file changed, 19 insertions(+), 6 deletions(-) diff --git a/RH-Engine/CreateGraphics.cs b/RH-Engine/CreateGraphics.cs index 062908c..154e993 100644 --- a/RH-Engine/CreateGraphics.cs +++ b/RH-Engine/CreateGraphics.cs @@ -59,9 +59,9 @@ namespace RH_Engine dynamic payload = new { id = "scene/terrain/update", - data = new + data = new { - + } }; return JsonConvert.SerializeObject(Payload(payload)); @@ -87,7 +87,7 @@ namespace RH_Engine return JsonConvert.SerializeObject(Payload(payload)); } - public string DeleteGroundPaneCommand(string uuid) + public string DeleteNode(string uuid) { dynamic payload = new @@ -106,15 +106,20 @@ namespace RH_Engine public string AddBikeModel() { - return AddModel("bike", "data\\NetworkEngine\\models\\bike\\bike.fbx", null); + return AddModel("bike", "data\\NetworkEngine\\models\\bike\\bike.fbx"); } public string AddModel(string nodeName, string fileLocation) { - return AddModel(nodeName, fileLocation, null); + return AddModel(nodeName, fileLocation, null, new float[]{ 0,0,0} ,1, new float[] { 0, 0, 0 }); } - public string AddModel(string nodeName, string fileLocation, string animationLocation) + public string AddModel(string nodeName, string fileLocation, float[] positionVector, float scalar, float[] rotationVector) + { + return AddModel(nodeName, fileLocation, null, positionVector, scalar, rotationVector); + } + + public string AddModel(string nodeName, string fileLocation, string animationLocation, float[] positionVector, float scalar, float[] rotationVector) { string namename = nodeName; bool animatedBool = false; @@ -131,6 +136,13 @@ namespace RH_Engine name = namename, components = new { + transform = new + { + position = positionVector, + scale = scalar, + rotation = rotationVector + + }, model = new { file = fileLocation, @@ -202,6 +214,7 @@ namespace RH_Engine } + private object Payload(dynamic message) { return new