Example #1
0
        public void AquireTarget()
        {
            for (int i = 0; i < 25; i++)
            {
                MyDetectedEntityInfo detected = default(MyDetectedEntityInfo);
                if (i == 0)
                {
                    detected = mainCam.Raycast(detectionRange);
                }
                else
                {
                    float pitch = random.Next(1, 50) / 10f;
                    float yaw   = random.Next(1, 50) / 10f;

                    detected = mainCam.Raycast(detectionRange, pitch, yaw);
                }



                if (detected.HitPosition.HasValue)
                {
                    detection = new LongRangeDetection(detected.HitPosition.Value, cameras, this);
                    Echo($"Target aquired @ {detected.HitPosition.ToString()}");

                    if (projector != null)
                    {
                        projector.Enable();
                    }

                    break;
                }

                DisposeAuto();
            }
        }
Example #2
0
        public void DisposeDetection()
        {
            detection = null;

            if (projector != null)
            {
                projector.Disable();
            }

            if (leadProjector != null)
            {
                leadProjector.Disable();
            }
        }
Example #3
0
 void NewLongRangeDetection(Vector3D position)
 {
     longRangeDetection = new LongRangeDetection(position, cameras, rc.GetPosition());
     longRangeDetection.OnTargetFound += OnTargetDetected;
 }