Beispiel #1
0
        /**
         * Identical to Frame(history) but instead of constructing a new frame and returning
         * it, the user provides a frame object to be filled with data instead.
         *
         * @param toFill The frame object to fill with tracking data.
         * @param history The age of the frame to return.
         */
        public void Frame(Frame toFill, int history)
        {
            LEAP_TRACKING_EVENT trackingEvent;

            _connection.Frames.Get(out trackingEvent, history);
            toFill.CopyFrom(ref trackingEvent);
        }
Beispiel #2
0
        /**
         * @if UNITY
         * In most cases you should get Frame objects using the LeapProvider::CurrentFrame
         * properties. The data in Frame objects taken directly from a Leap.Controller instance
         * is still in the Leap Motion frame of reference and will not match the hands
         * displayed in a Unity scene.
         * @endif
         *
         * Returns a frame of tracking data from the Leap Motion software. Use the optional
         * history parameter to specify which frame to retrieve. Call frame() or
         * frame(0) to access the most recent frame; call frame(1) to access the
         * previous frame, and so on. If you use a history value greater than the
         * number of stored frames, then the controller returns an empty frame.
         *
         * \include Controller_Frame_1.txt
         *
         * @param history The age of the frame to return, counting backwards from
         * the most recent frame (0) into the past and up to the maximum age (59).
         * @returns The specified frame; or, if no history parameter is specified,
         * the newest frame. If a frame is not available at the specified history
         * position, an invalid Frame is returned.
         * @since 1.0
         */
        public Frame Frame(int history)
        {
            Frame frame = new Frame();
            LEAP_TRACKING_EVENT trackingEvent;

            _connection.Frames.Get(out trackingEvent, history);
            frame.CopyFrom(ref trackingEvent);
            return(frame);
        }