Skip to content

Commit

Permalink
Fix some visualisation bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BenoitGeslain committed Feb 27, 2024
1 parent 77ea8c2 commit 28f064c
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ namespace VHToolkit.Logging {
[Serializable]
struct WorldRedirectionData {
[SerializeField] public float overTime, rotational, curvature, hybrid, total;
[SerializeField] public float time;
[SerializeField] float time;

public void AddTo(float overTime, float rotational, float curvature, float hybrid, float total, float time) {
this.overTime += Mathf.Abs(overTime);
Expand All @@ -31,7 +31,7 @@ public class Socket : MonoBehaviour {

private Razzaque2001Hybrid loggingTechnique;

private WorldRedirectionData redirectionData;
private WorldRedirectionData redirectionData = new();

private void Start() {
scene = Toolkit.Instance.GetComponent<WorldRedirection>().scene;
Expand All @@ -51,7 +51,6 @@ private void StartSendingMessages() {
} else {
Thread thread = new(() => SendMessage(client, redirectionData));
thread.Start();
redirectionData = new();
}
}

Expand All @@ -73,14 +72,12 @@ private void SendMessage(TcpClient client, WorldRedirectionData redirectionData)
}

private void Update() {
if (client != null && client.Connected) {
redirectionData.AddTo(Razzaque2001OverTimeRotation.GetRedirection(scene),
Razzaque2001Rotational.GetRedirection(scene),
Razzaque2001Curvature.GetRedirection(scene),
loggingTechnique.GetRedirection(scene),
(scene.HeadToHeadRedirection.eulerAngles.y > 180f) ? 360f - scene.HeadToHeadRedirection.eulerAngles.y : scene.HeadToHeadRedirection.eulerAngles.y,
(float)(DateTime.Now - startTime).TotalSeconds);
}
}
}
}

0 comments on commit 28f064c

Please sign in to comment.