Beispiel #1
0
        private static void InvokeTangoTrackingEvent(TrackingStateEventType eventType, CoordinateFrame frame)
        {
            Action <CoordinateFrame> callback = null;

            switch (eventType)
            {
            case TrackingStateEventType.TrackingAcquired:
                callback = trackingAcquired;
                break;

            case TrackingStateEventType.TrackingLost:
                callback = trackingLost;
                break;

            default:
                throw new ArgumentException("TrackingEventHandler - Invalid EventType: " + eventType);
            }

            if (callback != null)
            {
                callback(frame);
            }
        }
        private static void InvokeTrackingEvent(TrackingStateEventType eventType, XRNode nodeType, long uniqueID, bool tracked)
        {
            Action <XRNodeState> callback      = null;
            XRNodeState          callbackParam = new XRNodeState();

            callbackParam.uniqueID = (ulong)uniqueID;
            callbackParam.nodeType = nodeType;
            callbackParam.tracked  = tracked;

            switch (eventType)
            {
            case TrackingStateEventType.TrackingAcquired:
                callback = trackingAcquired;
                break;

            case TrackingStateEventType.TrackingLost:
                callback = trackingLost;
                break;

            case TrackingStateEventType.NodeAdded:
                callback = nodeAdded;
                break;

            case TrackingStateEventType.NodeRemoved:
                callback = nodeRemoved;
                break;

            default:
                throw new ArgumentException("TrackingEventHandler - Invalid EventType: " + eventType);
            }

            if (null != callback)
            {
                callback(callbackParam);
            }
        }