Browse Source

Fixed all routes and removed unnecessary log prints

Marcel Zickler 2 years ago
parent
commit
1065ae9785

+ 0 - 1
.idea/.idea.VR Cycling/.idea/.name

@@ -1 +0,0 @@
-VR Cycling

+ 0 - 1
.idea/.idea.VR Cycling/.idea/indexLayout.xml

@@ -34,7 +34,6 @@
       <Path>Integrations</Path>
       <Path>Library</Path>
       <Path>Logs</Path>
-      <Path>Temp</Path>
       <Path>UserSettings</Path>
       <Path>obj</Path>
       <Path>out</Path>

File diff suppressed because it is too large
+ 112 - 112
Assets/Scenes/MainScene.unity


+ 1 - 1
Assets/Scripts/Logging/FPSLogger.cs

@@ -48,7 +48,7 @@ namespace Logging
                 fpsNextPeriod += FPSMeasurePeriod;
             }
 
-            Debug.Log($"Current FPS = {currentFps}");
+            //Debug.Log($"Current FPS = {currentFps}");
 
             Log(new FPSData(Helpers.RoundToLong(Time.time * 1000f), currentFps));
         }

+ 14 - 19
Assets/Scripts/Routes/RouteManager.cs

@@ -37,36 +37,31 @@ namespace Routes
 
             var difStartFirstTurn = firstTurnPos - startTransform.position;
             Vector3 bikeDirection = Vector3.zero;
-            Vector3 bikeRotation = Vector3.zero;
 
-            if (difStartFirstTurn.x > 1 || difStartFirstTurn.z > 1)
+            if (difStartFirstTurn.x > 1)
             {
-                bikeDirection = startTransform.right;
-                bikeRotation = new Vector3(0, -90, 0);
+                bikeDirection = new Vector3(-1, 0, 0);
             }
-            /*else if (difStartFirstTurn.z > 1)
+            else if (difStartFirstTurn.z > 1)
             {
-                bikeDirection = startTransform.forward;
-                bikeRotation = new Vector3(0, -180, 0);
-            }*/
-            else if (difStartFirstTurn.x < -1 || difStartFirstTurn.z < -1)
+                bikeDirection = new Vector3(0, 0, -1);
+            }
+            else if (difStartFirstTurn.x < -1)
             {
-                bikeDirection = -startTransform.right;
-                bikeRotation = new Vector3(0, 90, 0);
+                bikeDirection = new Vector3(1, 0, 0);
+
             }
-            /*else if (difStartFirstTurn.z < -1)
+            else if (difStartFirstTurn.z < -1)
             {
-                bikeDirection = -startTransform.forward;
-                bikeRotation = new Vector3(0, 180, 0);
-            }*/
+                bikeDirection = new Vector3(0, 0, 1);
+            }
 
             bicycleGameObject = bicycle.gameObject;
-            bicycleGameObject.transform.SetPositionAndRotation(
-                startTransform.position + bikeDirection * 12,
-                Quaternion.Euler(startRotationEuler + bikeRotation));
+            bicycleGameObject.transform.position =
+                startTransform.position + bikeDirection * 12;
+            bicycleGameObject.transform.LookAt(startTransform);
         }
 
-
         private void OnOnFinishPassed()
         {
             //bicycle.enabled = false;

+ 1 - 11
Assets/Scripts/SicknessReduction/DynamicReductionSource.cs

@@ -83,16 +83,6 @@ namespace SicknessReduction
             var slopeSuggestion = useSlope ? slopeSuggestor.Suggestion * slopeMultiplier : 0f;
 
             var maxSuggestion = Mathf.Max(steerSuggestion, speedSuggestion, slopeSuggestion);
-            if (Math.Abs(maxSuggestion - steerSuggestion) < 0.01f)
-            {
-                Debug.Log("Suggestion won by Steer");
-            }else if (Math.Abs(maxSuggestion - speedSuggestion) < 0.01f)
-            {
-                Debug.Log("Suggestion won by Speed");
-            }else if (Math.Abs(maxSuggestion - slopeSuggestion) < 0.01f)
-            {
-                Debug.Log("Suggestion won by Slope");
-            }
             var desiredValue = Mathf.Min(maxSuggestion, maxValue);
 
             var desiredChange = desiredValue - currentValue;
@@ -101,7 +91,7 @@ namespace SicknessReduction
 
             currentValue = Mathf.Clamp(currentValue + change, 0, 1);
 
-            Debug.Log($"SuggestionValue = {currentValue}");
+            //Debug.Log($"SuggestionValue = {currentValue}");
         }
     }
 }

+ 2 - 3
Assets/Scripts/SicknessReduction/Haptic/VibrationController.cs

@@ -75,7 +75,6 @@ namespace SicknessReduction.Haptic
 
         private async Task StopVibrating()
         {
-            Debug.Log("Stop Vibrating");
             await Broker.Publish(TOPIC_CYCLE, "0");
             currentCycle = 0;
         }
@@ -126,14 +125,14 @@ namespace SicknessReduction.Haptic
         {
             if (Math.Abs(cycleValue - currentCycle) > 0)
             {
-                Debug.Log($"Sending Cycle {cycleValue}");
+                //Debug.Log($"Sending Cycle {cycleValue}");
                 await Broker.Publish(TOPIC_CYCLE, $"{cycleValue}");
             }
         }
 
         private async Task PublishCadence(int cadence)
         {
-            Debug.Log($"Sending Cadence {cadence}");
+            //Debug.Log($"Sending Cadence {cadence}");
             await Broker.Publish(TOPIC_CADENCE, $"{cadence}");
             previousCadence = cadence;
         }

BIN
obj/Debug/Assembly-CSharp.csprojAssemblyReference.cache


Some files were not shown because too many files changed in this diff