Skip to content
This repository was archived by the owner on May 26, 2025. It is now read-only.

Commit 388b95c

Browse files
committed
working on final tweaks. Getting json error
1 parent 14e907e commit 388b95c

File tree

10 files changed

+385
-86
lines changed

10 files changed

+385
-86
lines changed

Assets/HMDComponents/CompassSystem/Scripts/Compass.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ void Start()
2323
// Update is called once per frame
2424
void Update()
2525
{
26-
float cameraYaw = Camera.main.transform.rotation.eulerAngles.y;
26+
/*float cameraYaw = Camera.main.transform.rotation.eulerAngles.y;
2727
2828
if (Time.time - lastTime > 1)
2929
{
30-
lastTime = Time.time;
30+
lastTime = Time.deltaTime;
3131
string IMUstring = conn.GetIMUJsonString();
3232
3333
// Load IMU data into map
@@ -44,6 +44,6 @@ void Update()
4444
//Debug.Log(cameraYaw);
4545
4646
// Rotate image
47-
CompassImage.uvRect = new Rect(cameraYaw / 360, 0, 1, 1);
47+
CompassImage.uvRect = new Rect(cameraYaw / 360, 0, 1, 1);*/
4848
}
4949
}

Assets/HMDComponents/Flare/FlareDetection.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ public class FlareRemoval : MonoBehaviour
1414
// Start is called before the first frame update
1515
public Camera mainCamera;
1616
public NNModel modelAsset;
17-
public Canvas textCanvas;
17+
public Canvas flareCanvas;
1818

19-
public bool isEnabled;
19+
public bool isFlareEnabled;
2020

2121
float lastTime;
2222

@@ -36,10 +36,10 @@ void Start()
3636
// Update is called once per frame
3737
void Update()
3838
{
39-
if (Time.time - lastTime < 3 || !isEnabled) { return; }
39+
if (Time.time - lastTime < 3 || !isFlareEnabled) { return; }
4040

4141

42-
lastTime = Time.time;
42+
lastTime = Time.deltaTime;
4343

4444
Rect rect = new Rect(0, 0, mainCamera.pixelWidth, mainCamera.pixelHeight);
4545
RenderTexture renderTexture = new RenderTexture(mainCamera.pixelWidth, mainCamera.pixelHeight, 24);
@@ -68,11 +68,11 @@ void Update()
6868

6969
if (flare >= 0.6)
7070
{
71-
textCanvas.enabled = true;
71+
flareCanvas.enabled = false;
7272
}
7373
else
7474
{
75-
textCanvas.enabled = false;
75+
flareCanvas.enabled = false;
7676
}
7777
}
7878
float softmax(float x, float y)

Assets/HMDComponents/HardProcedures/HardProcedures.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using TMPro;
4-
using Unity.VisualScripting;
5-
using UnityEditor.Hardware;
64
using UnityEngine;
7-
using UnityEngine.InputSystem.HID;
8-
using UnityEngine.InputSystem;
9-
using UnityEngine.SocialPlatforms;
105
using UnityEngine.UI;
11-
using static UnityEditor.Experimental.GraphView.GraphView;
12-
using static UnityEditor.PlayerSettings;
136

147
public class HardProcedures : MonoBehaviour
158
{

Assets/HMDComponents/HardProcedures/HardProcedures2.cs

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,8 @@
11
using System;
22
using System.Collections.Generic;
33
using TMPro;
4-
using Unity.VisualScripting;
5-
using UnityEditor.Hardware;
64
using UnityEngine;
7-
using UnityEngine.InputSystem.HID;
8-
using UnityEngine.InputSystem;
9-
using UnityEngine.SocialPlatforms;
105
using UnityEngine.UI;
11-
using static UnityEditor.Experimental.GraphView.GraphView;
12-
using static UnityEditor.PlayerSettings;
136

147
public class HardProcedures2 : MonoBehaviour
158
{

Assets/HMDComponents/MinimapSystem/Scripts/HandMenuController.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ public class HandMenuController : MonoBehaviour // basic scene managing script
2626
[Header("Toggle Geosammple Display")]
2727
[SerializeField] GameObject geosample;
2828

29+
[Header("Toggle Flare Detection")]
30+
[SerializeField] GameObject flareCanvas;
31+
2932
// Start is called before the first frame update
3033
void Start()
3134
{
@@ -117,4 +120,9 @@ public void ToggleGeosample()
117120
{
118121
geosample.SetActive(!geosample.activeSelf);
119122
}
123+
124+
public void ToggleFlare()
125+
{
126+
flareCanvas.SetActive(!flareCanvas.activeSelf);
127+
}
120128
}

Assets/HMDComponents/Networking/ConnectionHandler.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ public class ConnectionHandler : MonoBehaviour
1111
void Start()
1212
{
1313
if (PlayerPrefs.GetString("CurrentIP") == "") PlayerPrefs.SetString("CurrentIP", "172.20.3.66");
14+
PlayerPrefs.SetString("CurrentIP", "0.0.0.0"); // delete later
1415
GatewayConnection.ConnectToHost(PlayerPrefs.GetString("CurrentIP"), 3001);
1516
}
1617

0 commit comments

Comments
 (0)