示例#1
0
        /// <summary>
        /// Just proceeds and filters the position
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        private void updatePosition(float x, float y)
        {
            //pointFilter.filter(x, y);
            //x = pointFilter.X;
            //y = pointFilter.Y;

            if (firstUpdate)
            {
                xFilter     = new Butterworth(FREQUENCY, CUTOFF, x);
                yFilter     = new Butterworth(FREQUENCY, CUTOFF, y);
                firstUpdate = false;
            }
            else
            {
                x = (float)xFilter.filter(x);
                y = (float)yFilter.filter(y);
            }


            position.X = x;
            position.Y = y;
        }
        /// <summary>
        /// Just proceeds and filters the position
        /// </summary>
        /// <param name="x"></param>
        /// <param name="y"></param>
        private void updatePosition(float x, float y)
        {
            //pointFilter.filter(x, y);
            //x = pointFilter.X;
            //y = pointFilter.Y;

            if (firstUpdate)
            {
                xFilter = new Butterworth(FREQUENCY, CUTOFF, x);
                yFilter = new Butterworth(FREQUENCY, CUTOFF, y);
                firstUpdate = false;
            }
            else
            {
                x = (float)xFilter.filter(x);
                y = (float)yFilter.filter(y);
            }

            position.X = x;
            position.Y = y;
        }