Exemple #1
0
        private bool IsArMarkerValid(ArMarker marker)
        {
            if (!marker.HasDetectedCamera)
            {
                return(false);
            }

            var isMarkerRecent = IsRecent(marker.CameraDetectionTime, MarkerDetectionCutoffTime);

            if (!isMarkerRecent)
            {
                return(false);
            }

            var hasMarkerChangedRecently = IsRecent(marker.LastChangeTime, MarkerChangeCutoffTime);

            if (hasMarkerChangedRecently)
            {
                return(false);
            }

            //var optitrackPose = OptitrackListener.GetPose(Globals.OptitrackHmdName);
            var hmdPos       = VRListener.CurrentPosition;
            var isTooFarAway = Mathf.Abs((hmdPos - marker.transform.position).magnitude) > MaxMarkerHmdDistance;

            if (isTooFarAway)
            {
                return(false);
            }

            // TODO: angle between hmd direction & marker? (probably not necessary) - needs intersection
            // TODO: confidence, if available?

            return(true);
        }
Exemple #2
0
 public static void Add(ArMarker marker)
 {
     _markers.Add(marker);
 }
Exemple #3
0
 public static void Remove(ArMarker marker)
 {
     _markers.Remove(marker);
 }