From 0eb387a62f7a1c2cd01f42c9c8ffdfddd155e7d2 Mon Sep 17 00:00:00 2001 From: RubberDuckShobe <64215152+CLfamilaris@users.noreply.github.com> Date: Tue, 22 Aug 2023 17:10:48 +0200 Subject: [PATCH] Reset global rotation on raycasts + fix decimal seperator stuff --- scripts/GameConnection.cs | 6 ++++-- scripts/SensorTrigger.cs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/scripts/GameConnection.cs b/scripts/GameConnection.cs index ee6cb93..2ba4ef8 100644 --- a/scripts/GameConnection.cs +++ b/scripts/GameConnection.cs @@ -1,5 +1,6 @@ using Godot; using System.Collections.Generic; +using System.Globalization; using System.Text; using VRDOM; @@ -10,6 +11,7 @@ public partial class GameConnection : Node [Export] private FootSensor _footSensor; + private CultureInfo formatLocale = new("en-US"); private WebSocketPeer _wsPeer = new(); readonly double lightingGetInterval = 0.0166; double lightingGetTimer = 0; @@ -30,11 +32,11 @@ public partial class GameConnection : Node string touchCommandString = "{\"id\":1,\"module\":\"drs\",\"function\":\"touch_set\",\"params\":["; foreach (var touchCommand in touchCommands) { - touchCommandString += "[" + touchCommand.touchEvent + "," + touchCommand.sensorId + "," + touchCommand.touchPosition.X.ToString("0.0000") + "," + touchCommand.touchPosition.Y.ToString("0.0000") + "," + touchCommand.touchSize.X + "," + touchCommand.touchSize.Y + "],"; + // honestly what did i smoke when i wrote this, i should REALLY go back and change this?? maybe? + touchCommandString += "[" + touchCommand.touchEvent + "," + touchCommand.sensorId + "," + touchCommand.touchPosition.X.ToString("0.0000", formatLocale) + "," + touchCommand.touchPosition.Y.ToString("0.0000", formatLocale) + "," + touchCommand.touchSize.X.ToString("0.0000", formatLocale) + "," + touchCommand.touchSize.Y.ToString("0.0000", formatLocale) + "],"; } touchCommandString = touchCommandString.Remove(touchCommandString.Length - 1); touchCommandString += "]}"; - GD.Print(touchCommandString); _wsPeer.Send(Encoding.UTF8.GetBytes(touchCommandString)); } } diff --git a/scripts/SensorTrigger.cs b/scripts/SensorTrigger.cs index 7754550..326b0e3 100644 --- a/scripts/SensorTrigger.cs +++ b/scripts/SensorTrigger.cs @@ -15,6 +15,6 @@ public partial class SensorTrigger : Area3D // Called every frame. 'delta' is the elapsed time since the previous frame. public override void _Process(double delta) { - rayCast.Rotation = Vector3.Zero; + rayCast.GlobalRotation = Vector3.Zero; } }