From c69c3193d4a7bbb6fa85336c2047cc29d8016b7b Mon Sep 17 00:00:00 2001 From: shinichi Date: Fri, 18 Sep 2020 15:56:34 +0200 Subject: [PATCH] added moveTo not working --- RH-Engine/CreateGraphics.cs | 27 ++++++++++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/RH-Engine/CreateGraphics.cs b/RH-Engine/CreateGraphics.cs index 154e993..2ce7a06 100644 --- a/RH-Engine/CreateGraphics.cs +++ b/RH-Engine/CreateGraphics.cs @@ -111,7 +111,7 @@ namespace RH_Engine public string AddModel(string nodeName, string fileLocation) { - return AddModel(nodeName, fileLocation, null, new float[]{ 0,0,0} ,1, new float[] { 0, 0, 0 }); + return AddModel(nodeName, fileLocation, null, new float[] { 0, 0, 0 }, 1, new float[] { 0, 0, 0 }); } public string AddModel(string nodeName, string fileLocation, float[] positionVector, float scalar, float[] rotationVector) @@ -157,6 +157,31 @@ namespace RH_Engine return JsonConvert.SerializeObject(Payload(payload)); } + public string MoveTo(string uuid, float[] positionVector, float rotateValue, float speedValue, float timeValue) + { + return MoveTo(uuid, "idk", positionVector, rotateValue, "linear", false, speedValue, timeValue); + } + + private string MoveTo(string uuid, string stopValue, float[] positionVector, float rotateValue, string interpolateValue, bool followHeightValue, float speedValue, float timeValue) + { + dynamic payload = new + { + id = "scene/node/moveto", + data = new + { + id = uuid, + stop = stopValue, + position = positionVector, + rotate = rotateValue, + interpolate = interpolateValue, + followheight = followHeightValue, + speed = speedValue, + time = timeValue + } + }; + return JsonConvert.SerializeObject(Payload(payload)); + } + public string RouteCommand() {