예제 #1
0
        private static void IAnchorUpdate(ARImageAnchor anchor)
        {
            Logger.log(Logger.Type.Info, "IAnchorUpdate");

            if (!tracking)
            {
                Logger.log(Logger.Type.Info, "tracking paused. Ignore.");
                return;
            }

            if (!anchors.Contains(anchor.identifier))
            {
                Logger.log(Logger.Type.Warning, "=> IAnchorAdd (tracking was probably off and just turned on).");
                IAnchorAdd(anchor);
                return;
            }

            if (IAnchorUpdated == null)
            {
                Logger.log(Logger.Type.Info, "no delegates for this event.");
                return;
            }

            Logger.log(Logger.Type.Info, "dispatch event.");
            IAnchor a = new IAnchor(anchor.identifier, UnityARMatrixOps.GetPose(anchor.transform), anchor.isTracked, anchor.referenceImageName);

            IAnchorUpdated(a);
        }
예제 #2
0
        private static void IAnchorAdd(ARImageAnchor anchor)
        {
            Logger.log(Logger.Type.Info, "IAnchorAdd");

            if (!tracking)
            {
                Logger.log(Logger.Type.Info, "tracking paused. Ignore.");
                return;
            }

            if (!anchors.Add(anchor.identifier))
            {
                Logger.log(Logger.Type.Warning, "anchor was already added: {0}", anchor.identifier);
                return;
            }

            if (IAnchorAdded == null)
            {
                Logger.log(Logger.Type.Info, "no delegates for this event.");
                return;
            }

            Logger.log(Logger.Type.Info, "dispatch event.");
            IAnchor a = new IAnchor(anchor.identifier, UnityARMatrixOps.GetPose(anchor.transform), anchor.isTracked, anchor.referenceImageName);

            IAnchorAdded(a);
        }
예제 #3
0
        private static void IAnchorUpdate(AugmentedImage anchor)
        {
            if (!anchors.Contains(anchor.DatabaseIndex.ToString()))
            {
                IAnchorAdd(anchor);
                return;
            }

            Logger.log(Logger.Type.Info, "IAnchorUpdate");

            if (!tracking)
            {
                Logger.log(Logger.Type.Info, "tracking paused. Ignore.");
                return;
            }

            if (IAnchorUpdated == null)
            {
                Logger.log(Logger.Type.Info, "no delegates for this event.");
                return;
            }

            Logger.log(Logger.Type.Info, "dispatch event.");

            bool    isTracking = anchor.TrackingState == TrackingState.Tracking;
            IAnchor a          = new IAnchor(anchor.DatabaseIndex.ToString(), anchor.CenterPose, isTracking, anchor.Name);

            IAnchorUpdated(a);
        }