Browse Source

Cleanup code

Nick Steyer 1 year ago
parent
commit
68b0159535

+ 0 - 2
Assembly-CSharp.csproj

@@ -86,7 +86,6 @@
     <Compile Include="Assets\ZED\Examples\MultiCam\Scripts\CopyToSurface.cs" />
     <Compile Include="Assets\StreetLight\PersonVisualizer.cs" />
     <Compile Include="Assets\ZED\Examples\OpenCV ArUco Detection\Scripts\Core\ZEDToOpenCVRetriever.cs" />
-    <Compile Include="Assets\StreetLight\Poco\HomographyCorrespondence.cs" />
     <Compile Include="Assets\Pong\Bumper.cs" />
     <Compile Include="Assets\ZED\SDK\Helpers\Scripts\Utilities\GUIMessage.cs" />
     <Compile Include="Assets\Logging\DetectionFrameLogger.cs" />
@@ -197,7 +196,6 @@
     <Compile Include="Assets\ZED\Examples\Drone Shooter\Scripts\Simple\LaserShot_Drone.cs" />
     <Compile Include="Assets\StreetLight\Poco\Person.cs" />
     <Compile Include="Assets\ZED\Tools\Mixed Reality Calibration\Scripts\TempAudioObject.cs" />
-    <Compile Include="Assets\StreetLight\Poco\CalibrationPoint.cs" />
     <Compile Include="Assets\ZED\SDK\Helpers\Scripts\Utilities\Utils.cs" />
     <Compile Include="Assets\Logging\Poco\DetectedObject.cs" />
     <Compile Include="Assets\ZED\Examples\GreenScreen\Scripts\GarbageMatte.cs" />

+ 0 - 11
Assets/Pong/Ball.cs

@@ -8,11 +8,6 @@ public class Ball : MonoBehaviour
     public bool IsInUse { get; private set; }
     public float speed = 5f;
 
-    // Start is called before the first frame update
-    void Start()
-    {
-    }
-
     public void Recenter()
     {
         var component = GetComponent<Rigidbody>();
@@ -31,10 +26,4 @@ public class Ball : MonoBehaviour
 
         IsInUse = true;
     }
-
-    // Update is called once per frame
-    void Update()
-    {
-        
-    }
 }

+ 7 - 4
Assets/Pong/Bumper.cs

@@ -1,3 +1,5 @@
+using Assets.StreetLight.Scripts;
+using System;
 using System.Collections;
 using System.Collections.Generic;
 using UnityEngine;
@@ -7,13 +9,14 @@ public class Bumper : MonoBehaviour
     public bool isBump1;
     public float speed = 5f;
 
-    // Start is called before the first frame update
-    void Start()
+    PersonManager PersonManager => personManagerLazy.Value;
+    Lazy<PersonManager> personManagerLazy;
+
+    private void Awake()
     {
-        
+        personManagerLazy = new Lazy<PersonManager>(FindObjectOfType<PersonManager>);
     }
 
-    // Update is called once per frame
     void Update()
     {
         if (isBump1)

+ 0 - 23
Assets/StreetLight/Poco/CalibrationPoint.cs

@@ -1,23 +0,0 @@
-using System.Diagnostics;
-using UnityEngine;
-
-namespace Assets.StreetLight.Poco
-{
-    [DebuggerDisplay("{" + nameof(GetDebuggerDisplay) + "(),nq}")]
-    public class CalibrationPoint
-    {
-        public Vector3 WorldPosition { get; }
-        public Vector3 UnityPosition { get; }
-
-        public CalibrationPoint(Vector3 worldPosition, Vector3 unityPosition)
-        {
-            WorldPosition = worldPosition;
-            UnityPosition = unityPosition;
-        }
-
-        private string GetDebuggerDisplay()
-        {
-            return $"World: {WorldPosition}, Unity: {UnityPosition}";
-        }
-    }
-}

+ 0 - 11
Assets/StreetLight/Poco/CalibrationPoint.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: 841a7d3018fe28d4fa21f3c6a81825b3
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 23
Assets/StreetLight/Poco/HomographyCorrespondence.cs

@@ -1,23 +0,0 @@
-using MathNet.Numerics.LinearAlgebra;
-using System.Diagnostics;
-
-namespace Assets.StreetLight.Poco
-{
-    [DebuggerDisplay("{" + nameof(GetDebuggerDisplay) + "(),nq}")]
-    public class HomographyCorrespondence
-    {
-        public Vector<double> WorldPosition { get; }
-        public Vector<double> UnityPosition { get; }
-
-        public HomographyCorrespondence(Vector<double> worldPosition, Vector<double> unityPosition)
-        {
-            WorldPosition = worldPosition;
-            UnityPosition = unityPosition;
-        }
-
-        private string GetDebuggerDisplay()
-        {
-            return $"World: {WorldPosition}, Unity: {UnityPosition}";
-        }
-    }
-}

+ 0 - 11
Assets/StreetLight/Poco/HomographyCorrespondence.cs.meta

@@ -1,11 +0,0 @@
-fileFormatVersion: 2
-guid: e9a79cc4f86779d46bd1eb5404337682
-MonoImporter:
-  externalObjects: {}
-  serializedVersion: 2
-  defaultReferences: []
-  executionOrder: 0
-  icon: {instanceID: 0}
-  userData: 
-  assetBundleName: 
-  assetBundleVariant: 

+ 0 - 1
Assets/StreetLight/Poco/Person.cs

@@ -11,7 +11,6 @@ namespace Assets.StreetLight.Poco
         public int Id { get; }
         public event PropertyChangedEventHandler PropertyChanged;
 
-        // todo: make world position private and add get position method for unity position
         private Vector3 worldPosition = Vector3.zero;
         private readonly PositionCalculator positionCalculator;