예제 #1
0
        /// <summary>
        /// Setup the calibration data which we want to use to transform points received by this Wiimote device before presenting
        /// them to the higher level application.
        /// </summary>
        /// <param name="pSource">The source rectangle.</param>
        /// <param name="pDestination">The destination rectangle.</param>
        /// <param name="vSize">The size of the screen which we will use to normalise input coordinates.</param>
        public void setCalibrationData(CalibrationRectangle pSource, CalibrationRectangle pDestination, Vector vSize)
        {
            // Set the source and destination.
            this.pWarper.setSource((float)pSource.TopLeft.X, (float)pSource.TopLeft.Y,
                                   (float)pSource.TopRight.X, (float)pSource.TopRight.Y,
                                   (float)pSource.BottomLeft.X, (float)pSource.BottomLeft.Y,
                                   (float)pSource.BottomRight.X, (float)pSource.BottomRight.Y);

            this.pWarper.setDestination((float)pDestination.TopLeft.X, (float)pDestination.TopLeft.Y,
                                        (float)pDestination.TopRight.X, (float)pDestination.TopRight.Y,
                                        (float)pDestination.BottomLeft.X, (float)pDestination.BottomLeft.Y,
                                        (float)pDestination.BottomRight.X, (float)pDestination.BottomRight.Y);

            // Save the newly computed screen size.
            this.ScreenSize = vSize;

            // Compute the new values.
            this.pWarper.computeWarp();
        }
예제 #2
0
        /// <summary>
        /// Setup the calibration data which we want to use to transform points received by this Wiimote device before presenting
        /// them to the higher level application.
        /// </summary>
        /// <param name="pSource">The source rectangle.</param>
        /// <param name="pDestination">The destination rectangle.</param>
        /// <param name="vSize">The size of the screen which we will use to normalise input coordinates.</param>
        public void setCalibrationData(CalibrationRectangle pSource, CalibrationRectangle pDestination, Vector vSize)
        {
            // Set the source and destination.
            this.pWarper.setSource((float)pSource.TopLeft.X, (float)pSource.TopLeft.Y,
                                    (float)pSource.TopRight.X, (float)pSource.TopRight.Y,
                                    (float)pSource.BottomLeft.X, (float)pSource.BottomLeft.Y,
                                    (float)pSource.BottomRight.X, (float)pSource.BottomRight.Y);

            this.pWarper.setDestination((float)pDestination.TopLeft.X, (float)pDestination.TopLeft.Y,
                                        (float)pDestination.TopRight.X, (float)pDestination.TopRight.Y,
                                        (float)pDestination.BottomLeft.X, (float)pDestination.BottomLeft.Y,
                                        (float)pDestination.BottomRight.X, (float)pDestination.BottomRight.Y);

            // Save the newly computed screen size.
            this.ScreenSize = vSize;

            // Compute the new values.
            this.pWarper.computeWarp();
        }